Use Restrictions For Cross-Component Prediction

ABSTRACT

A method of video processing is provided. The method includes determining, for a conversion between a video comprising a video unit and a bitstream of the video, whether a first coding tool is enabled for the video unit according to a rule. The rule specifies that the first coding tool and a second coding tool are mutually exclusively enabled. The first coding tool or the second coding tool comprises a sign data hiding tool. The method also includes performing the conversion according to the determining.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a continuation of International Patent ApplicationNo. PCT/CN2021/088000 filed on Apr. 19, 2021, which claims the priorityto and benefits of International Patent Application No.PCT/CN2020/085484 filed on Apr. 18, 2020. All the aforementioned patentapplications are hereby incorporated by reference in their entireties.

TECHNICAL FIELD

This disclosure is related to video and image coding technologies.

BACKGROUND

Digital video accounts for the largest bandwidth use on the internet andother digital communication networks. As the number of connected userdevices capable of receiving and displaying video increases, it isexpected that the bandwidth demand for digital video usage will continueto grow.

SUMMARY

The disclosed techniques may be used by video or image decoder orencoder embodiments for performing encoding or decoding usingcross-component linear model prediction.

In one example aspect, a method of processing video is disclosed. Themethod includes deriving, for a conversion between a chroma block of avideo and a coded representation of the video, parameters of across-component linear model by using downsampled collocated neighboringtop luma samples that are generated from N above neighboring lines of acollocated luma block using a downsampling filter, where N is a positiveinteger; and performing the conversion using a predicted chroma blockgenerated using the cross-component linear model.

In another example aspect, a method of processing video is disclosed.The method includes determining, for a conversion between a video blockof a video having a 4:2:2 color format and a bitstream of the video, aparameter of a cross-component linear model for the video blockaccording to a rule; and performing the conversion based on thedetermining, and wherein a syntax element indicates whether chromasamples of the video are vertically shifted relative to luma samples ofthe video, and wherein the rule specifies that the parameter isdetermined independent of a value of the syntax element.

In another example aspect, a method of processing video is disclosed.The method includes performing a conversion between a video and abitstream of the video according to a rule, and wherein the format rulespecifies that a field indicating whether chroma samples positions arevertically shifted relative to corresponding luma sample positions isset to a default value due to the video having 4:2:2 or 4:4:4 colorformat.

In another example aspect, a method of processing video is disclosed.The method includes determining, for a conversion between a video blockof a video and a bitstream of the video, a parameter of across-component linear model (CCLM) for the video block according to arule; and performing the conversion based on the determining, andwherein the rule specifies to use a variable representing a neighbouringluma sample in the determining of the parameter of the CCLM only in casethat the variable has a certain value.

In another example aspect, a method of processing video is disclosed.The method includes determining, for a conversion between a videocomprising a video unit and a bitstream of the video, whether a firstcoding tool is enabled for the video unit according to a rule, whereinthe rule specifies that the first coding tool and a second coding toolare mutually exclusively enabled, and wherein the first coding tool orthe second coding tool comprises a sign data hiding tool; and performingthe conversion according to the determining.

In another example aspect, a method of processing video is disclosed.The method includes determining, for a conversion between a videocomprising a video unit and a bitstream of the video, whether a firstcoding tool is enabled for the video unit according to a rule, whereinthe rule specifies that the first coding tool and a second coding toolare mutually exclusively enabled, and wherein the first coding tool orthe second coding tool comprises a dependent quantization tool; andperforming the conversion according to the determining.

In another example aspect, a method of processing video is disclosed.The method includes performing a conversion between a video comprisingone or more pictures comprising one or more slices and a bitstream ofthe video according to a rule, and wherein the rule specifies that aslice type of a slice depends on reference picture entries of areference picture list for the slice.

In another example aspect, a method of processing video is disclosed.The method includes performing a conversion between a video comprisingone or more pictures comprising one or more slices and a bitstream ofthe video according to a rule, and wherein the rule specifies that anumber of allowed filters in adaptation parameter sets (APSs) or anumber of APSs depends on coded information of the video.

In another example aspect, the above-described method may be implementedby a video encoder apparatus that comprises a processor.

In yet another example aspect, these methods may be embodied in the formof processor-executable instructions and stored on a computer-readableprogram medium.

These, and other, aspects are further described in the presentdisclosure.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1A shows Nominal vertical and horizontal locations of 4:2:2 lumaand chroma samples in a picture.

FIG. 1B shows an example of a video encoder.

FIG. 2 shows examples of 67 intra prediction modes.

FIG. 3 shows examples of horizontal and vertical traverse scans.

FIG. 4 shows examples of locations of the samples used for thederivation of α and β.

FIG. 5 shows example of dividing a block of 4×8 samples into twoindependently decodable areas.

FIG. 6 shows an example order of processing of the rows of pixels tomaximize throughput for 4×N blocks with vertical predictor.

FIG. 7 shows an example of a Low-Frequency Non-Separable Transform(LFNST) process.

FIG. 8 shows an example of neighbouring chroma samples and downsampledcollocated neighbouring luma samples used in the derivation of CCLMparameters for 4:2:2 videos.

FIG. 9 shows an example of a video processing apparatus.

FIG. 10 shows a block diagram of a video encoder.

FIG. 11 is a flowchart for an example of a video processing method.

FIG. 12 is a block diagram for an example of a video processing system.

FIG. 13 shows an example of samples in current block and top-leftsamples to be used.

FIG. 14 is a block diagram that illustrates an example video codingsystem.

FIG. 15 is a block diagram that illustrates an encoder in accordancewith some embodiments of the disclosed technology.

FIG. 16 is a block diagram that illustrates a decoder in accordance withsome embodiments of the disclosed technology.

FIGS. 17A and 17B are flowcharts for example methods of video processingin accordance with some embodiments of the disclosed technology.

FIG. 18 is a flowchart for an example method of video processing inaccordance with some embodiments of the disclosed technology.

FIGS. 19A to 19D are flowcharts for example methods of video processingin accordance with some embodiments of the disclosed technology.

DETAILED DESCRIPTION

The present disclosure provides various techniques that can be used by adecoder of image or video bitstreams to improve the quality ofdecompressed or decoded digital video or images. For brevity, the term“video” is used herein to include both a sequence of pictures(traditionally called video) and individual images. Furthermore, a videoencoder may also implement these techniques during the process ofencoding in order to reconstruct decoded frames used for furtherencoding.

Section headings are used in the present disclosure for ease ofunderstanding and do not limit the embodiments and techniques to thecorresponding sections. As such, embodiments from one section can becombined with embodiments from other sections.

1. Brief Summary

This disclosure is related to video coding technologies. Specifically,it is related cross-component linear model prediction and other codingtools in image/video coding. It may be applied to the existing videocoding standard like High Efficiency Video Coding (HEVC), or thestandard Versatile Video Coding (VVC) to be finalized. It may be alsoapplicable to future video coding standards or video codec.

2. Background

Video coding standards have evolved primarily through the development ofthe well-known International Telecommunication Union-TelecommunicationStandardization Sector (ITU-T) and International Organization forStandardization (ISO)/International Electrotechnical Commission (IEC)standards. The ITU-T produced H.261 and H.263, ISO/IEC produced MovingPicture Experts Group (MPEG)-1 and MPEG-4 Visual, and the twoorganizations jointly produced the H.262/MPEG-2 Video and H.264/MPEG-4Advanced Video Coding (AVC) and H.265/HEVC standards. Since H.262, thevideo coding standards are based on the hybrid video coding structurewherein temporal prediction plus transform coding are utilized. Toexplore the future video coding technologies beyond HEVC, Joint VideoExploration Team (JVET) was founded by Video Coding Experts Group (VCEG)and MPEG jointly in 2015. Since then, many new methods have been adoptedby JVET and put into the reference software named Joint ExplorationModel (JEM). In April 2018, the Joint Video Expert Team (JVET) betweenVCEG (Q6/16) and ISO/IEC JTC1 SC29/WG11 (MPEG) was created to work onthe VVC standard targeting at 50% bitrate reduction compared to HEVC.

The latest version of VVC draft, i.e., Versatile Video Coding (Draft 7)could be found at:

http://phenix.it-sudparis.euhvet/doc_end_useridocuments/16_Geneva/wgVivET-P2001-v9.zip

The latest reference software of VVC, named VTM, could be found at:

https://vcgit.hhi.fraunhofer.dehvet/VVCSoftware_VTM/-/tags/VTM-6.0

2.1. Color Space and Chroma Subsampling

Color space, also known as the color model (or color system), is anabstract mathematical model which simply describes the range of colorsas tuples of numbers, typically as 3 or 4 values or color components(e.g., red green blue (RGB)). Basically speaking, color space is anelaboration of the coordinate system and sub-space.

For video compression, the most frequently used color spaces are YCbCrand RGB.

YCbCr, Y′CbCr, or Y Pb/Cb Pr/Cr, also written as YCBCR or Y′CBCR, is afamily of color spaces used as a part of the color image pipeline invideo and digital photography systems. Y′ is the luma component and CBand CR are the blue-difference and red-difference chroma components. Y′(with prime) is distinguished from Y, which is luminance, meaning thatlight intensity is nonlinearly encoded based on gamma corrected RGBprimaries.

Chroma subsampling is the practice of encoding images by implementingless resolution for chroma information than for luma information, takingadvantage of the human visual system's lower acuity for colordifferences than for luminance.

2.1.1. 4:4:4

Each of the three Y′CbCr components have the same sample rate, thusthere is no chroma subsampling. This scheme is sometimes used inhigh-end film scanners and cinematic post production.

2.1.2. 4:2:2

The two chroma components are sampled at half the sample rate of luma:the horizontal chroma resolution is halved while the vertical chromaresolution is unchanged. This reduces the bandwidth of an uncompressedvideo signal by one-third with little to no visual difference. Anexample of nominal vertical and horizontal locations of 4:2:2 colorformat is depicted in FIG. 1A in VVC working draft.

2.1.3. 4:2:0

In 4:2:0, the horizontal sampling is doubled compared to 4:1:1, but asthe Cb and Cr channels are only sampled on each alternate line in thisscheme, the vertical resolution is halved. The data rate is thus thesame. Cb and Cr are each subsampled at a factor of 2 both horizontallyand vertically. There are three variants of 4:2:0 schemes, havingdifferent horizontal and vertical siting.

-   -   In MPEG-2, Cb and Cr are cosited horizontally. Cb and Cr are        sited between pixels in the vertical direction (sited        interstitially),    -   In Joint Photographic Experts Group (JPEG)/JPEG File interchange        Format (JFIF), H.261, and MPEG-1, Cb and Cr are sited        interstitially, halfway between alternate luma samples.    -   In 4:2:0 DV, Cb and Cr are co-sited in the horizontal direction.        In the vertical direction, they are co-sited on alternating        lines.

TABLE 2-1 SubWidthC and SubHeightC values derived from chroma_format_idcand separate_colour_plane_flag • chroma_ separate_colour_ Chromaformat_idc plane_flag format SubWidthC SubHeightC 0 0 Monochrome 1 1 1 04:2:0 2 2 2 0 4:2:2 2 1 3 0 4:4:4 1 1 3 1 4:4:4 1 1

2.2. Coding Flow of a Typical Video Codec

FIG. 1B shows an example of encoder block diagram of VVC, which containsthree in-loop filtering blocks: deblocking filter (DF), sample adaptiveoffset (SAO) and adaptive loop filter (ALF). Unlike DF, which usespredefined filters, SAO and ALF utilize the original samples of thecurrent picture to reduce the mean square errors between the originalsamples and the reconstructed samples by adding an offset and byapplying a finite impulse response (FIR) filter, respectively, withcoded side information signalling the offsets and filter coefficients.ALF is located at the last processing stage of each picture and can beregarded as a tool trying to catch and fix artifacts created by theprevious stages.

2.3. Intra Mode Coding with 67 Intra Prediction Modes

To capture the arbitrary edge directions presented in natural video, thenumber of directional intra modes is extended from 33, as used in HEVC,to 65. The additional directional modes are depicted as red dottedarrows in FIG. 2 , and the planar and direct current (DC) modes remainthe same. These denser directional intra prediction modes apply for allblock sizes and for both luma and chroma intra predictions.

Conventional angular intra prediction directions are defined from 45degrees to −135 degrees in clockwise direction as shown in FIG. 2 . InVTM, several conventional angular intra prediction modes are adaptivelyreplaced with wide-angle intra prediction modes for the non-squareblocks. The replaced modes are signalled using the original method andremapped to the indexes of wide angular modes after parsing. The totalnumber of intra prediction modes is unchanged, i.e., 67, and the intramode coding is unchanged.

In the HEVC, every intra-coded block has a square shape and the lengthof each of its side is a power of 2. Thus, no division operations arerequired to generate an intra-predictor using DC mode. In VVC, blockscan have a rectangular shape that necessitates the use of a divisionoperation per block in the general case. To avoid division operationsfor DC prediction, only the longer side is used to compute the averagefor non-square blocks.

FIG. 2 shows examples of 67 intra prediction modes.

2.4. Inter Prediction

For each inter-predicted coding unit (CU), motion parameters consistingof motion vectors, reference picture indices and reference picture listusage index, and additional information needed for the new codingfeature of VVC to be used for inter-predicted sample generation. Themotion parameter can be signalled in an explicit or implicit manner.When a CU is coded with skip mode, the CU is associated with oneprediction unit (PU) and has no significant residual coefficients, nocoded motion vector delta or reference picture index. A merge mode isspecified whereby the motion parameters for the current CU are obtainedfrom neighbouring CUs, including spatial and temporal candidates, andadditional schedules introduced in VVC. The merge mode can be applied toany inter-predicted CU, not only for skip mode. The alternative to mergemode is the explicit transmission of motion parameters, where motionvector, corresponding reference picture index for each reference picturelist and reference picture list usage flag and other needed informationare signalled explicitly per each CU.

2.5. Intra Block Copy (IBC)

Intra block copy (IBC) is a tool adopted in HEVC extensions on screencontent coding (SCC). It is well known that it significantly improvesthe coding efficiency of screen content materials. Since IBC mode isimplemented as a block level coding mode, block matching (BM) isperformed at the encoder to find the optimal block vector (or motionvector) for each CU. Here, a block vector is used to indicate thedisplacement from the current block to a reference block, which isalready reconstructed inside the current picture. The luma block vectorof an IBC-coded CU is in integer precision. The chroma block vectorrounds to integer precision as well. When combined with adaptive motionvector resolution (AMVR), the IBC mode can switch between 1-pel and4-pel motion vector precisions. An IBC-coded CU is treated as the thirdprediction mode other than intra or inter prediction modes. The IBC modeis applicable to the CUs with both width and height smaller than orequal to 64 luma samples.

At the encoder side, hash-based motion estimation is performed for IBC.The encoder performs rate distortion (RD) check for blocks with eitherwidth or height no larger than 16 luma samples. For non-merge mode, theblock vector search is performed using hash-based search first. If hashsearch does not return valid candidate, block matching based localsearch will be performed.

In the hash-based search, hash key matching (32-bit cyclic redundancycheck (CRC)) between the current block and a reference block is extendedto all allowed block sizes. The hash key calculation for every positionin the current picture is based on 4×4 sub-blocks. For the current blockof a larger size, a hash key is determined to match that of thereference block when all the hash keys of all 4×4 sub-blocks match thehash keys in the corresponding reference locations. If hash keys ofmultiple reference blocks are found to match that of the current block,the block vector costs of each matched reference are calculated and theone with the minimum cost is selected.

In block matching search, the search range is set to cover both theprevious and current coding tree units (CTUs).

At CU level, IBC mode is signalled with a flag and it can be signalledas IBC AMVP mode or IBC skip/merge mode as follows:

-   -   IBC skip/merge mode: a merge candidate index is used to indicate        which of the block vectors in the list from neighbouring        candidate IBC coded blocks is used to predict the current block.        The merge list consists of spatial, history-based motion vector        prediction (HMVP), and pairwise candidates.    -   IBC AMVP mode: block vector difference is coded in the same way        as a motion vector difference. The block vector prediction        method uses two candidates as predictors, one from left        neighbour and one from above neighbour (if IBC coded). When        either neighbour is not available, a default block vector will        be used as a predictor. A flag is signalled to indicate the        block vector predictor index.

2.6. Palette Mode

For palette mode signalling, the palette mode is coded as a predictionmode for a coding unit, i.e., the prediction modes for a coding unit canbe MODE_INTRA, MODE_INTER, MODE_IBC and MODE_PLT. If the palette mode isutilized, the pixels values in the CU are represented by a small set ofrepresentative colour values. The set is referred to as the palette. Forpixels with values close to the palette colors, the palette indices aresignalled. For pixels with values outside the palette, the pixel isdenoted with an escape symbol and the quantized pixel values aresignalled directly.

To decode a palette encoded block, the decoder needs to decode palettecolors and indices. Palette colors are described by a palette table andencoded by palette table coding tools. An escape flag is signalled foreach CU to indicate if escape symbols are present in the current CU. Ifescape symbols are present, the palette table is augmented by one andthe last index is assigned to the escape mode. Palette indices of allpixels in a CU form a palette index map and are encoded by palette indexmap coding tools.

For coding of the palette table, a palette predictor is maintained. Thepredictor is initialized at the beginning of each slice where predictoris reset to 0. For each entry in the palette predictor, a reuse flag issignalled to indicate whether it is part of the current palette. Thereuse flags are sent using run-length coding of zeros. After this, thenumber of new palette entries are signalled using exponential Golombcode of order 0. Finally, the component values for the new paletteentries are signalled. After encoding the current CU, the palettepredictor will be updated using the current palette, and entries fromthe previous palette predictor which are not reused in the currentpalette will be added at the end of new palette predictor until themaximum size allowed is reached (palette stuffing).

For coding the palette index map, the indices are coded using horizontaland vertical traverse scans as shown in FIG. 3 . The scan order isexplicitly signalled in the bitstream using the palette transpose flag.

FIG. 3 shows examples of horizontal and vertical traverse scans.

The palette indices are coded using two main palette sample modes:‘INDEX’ and ‘COPY_ABOVE’. The mode is signalled using a flag except forthe top row when horizontal scan is used, the first column when thevertical scan is used, or when the previous mode was ‘COPY_ABOVE’. Inthe ‘COPY_ABOVE’ mode, the palette index of the sample in the row aboveis copied. In the ‘INDEX’ mode, the palette index is explicitlysignalled. For both ‘INDEX’ and ‘COPY_ABOVE’ modes, a run value issignalled which specifies the number pixels that are coded using thesame mode.

The encoding order for index map is as follows. First, the number ofindex values for the CU is signalled. This is followed by signalling ofthe actual index values for the entire CU using truncated binary coding.Both the number of indices as well as the index values are coded inbypass mode. This groups the index-related bypass bins together. Thenthe palette mode (INDEX or COPY_ABOVE) and run are signalled in aninterleaved manner. Finally, the component escape values correspondingto the escape samples for the entire CU are grouped together and codedin bypass mode. An additional syntax element, last_run_type_flag, issignalled after signalling the index values. This syntax element, inconjunction with the number of indices, eliminates the need to signalthe run value corresponding to the last run in the block.

In VTM, dual tree is enabled for I slice which separate the coding unitpartitioning for Luma and Chroma. Hence, in this proposal, palette isapplied on Luma (Y component) and Chroma (Cb and Cr components)separately. If dual tree is disabled, palette will be applied on Y, Cb,Cr components jointly, same as in HEVC palette.

2.7. Cross-Component Linear Model Prediction

A cross-component linear model (CCLM) prediction mode is used in theVVC, for which the chroma samples are predicted based on thereconstructed luma samples of the same CU by using a linear model asfollows:

pred_(C)(i,j)=α·rec _(L)′(i,j)+β  (2-1)

where pred_(C)(i,j) represents the predicted chroma samples in a CU andrec_(L)(i,j) represents the downsampled reconstructed luma samples ofthe same CU.

FIG. 4 shows an example of the location of the left and above samplesand the sample of the current block involved in the LM mode.

FIG. 4 shows examples of locations of the samples used for thederivation of α and β.

Besides the above template and left template can be used to calculatethe linear model coefficients together in linear model (LM) mode, theyalso can be used alternatively in the other 2 LM modes, called LM_A, andLM_L modes. In LM_A mode, only the above template is used to calculatethe linear model coefficients. To get more samples, the above templateis extended to (W+H). In LM_L mode, only left template is used tocalculate the linear model coefficients. To get more samples, the lefttemplate is extended to (H+W). For a non-square block, the abovetemplate is extended to W+W, the left template is extended to H+H.

The CCLM parameters (α and β) are derived with at most four neighbouringchroma samples and their corresponding down-sampled luma samples.Suppose the current chroma block dimensions are W×H, then W′ and H′ areset as

-   -   W′=W, H′=H when LM mode is applied;    -   W′=W+H when LM-A mode is applied;    -   H′=H+W when LM-L mode is applied;

The above neighbouring positions are denoted as S[0, −1] . . . S[W′−1,−1] and the left neighbouring positions are denoted as S[−1, 0] . . .S[−1, H′−1]. Then the four samples are selected as

-   -   S[W′/4, −1], S[3 W′/4, −1], S[−1, H′/4], S[−1, 3H′/4] when LM        mode is applied and both above and left neighbouring samples are        available;    -   S[W′/8, −1], S[3 W′/8, −1], S[5 W′/8, −1], S[7 W′/8, −1] when        LM-A mode is applied or only the above neighbouring samples are        available;    -   S[−1, H′/8], S[−1, 3H′/8], S[−1, 5H′/8], S[−1, 7H′/8] when LM-L        mode is applied or only the left neighbouring samples are        available;

The four neighbouring luma samples at the selected positions aredown-sampled and compared four times to find two smaller values: x⁰ _(A)and x¹ _(A), and two larger values: x⁰ _(B) and x¹ _(B). Theircorresponding chroma sample values are denoted as y⁰ _(A), y¹ _(A), y⁰_(B) and y¹ _(B). Then x_(A), x_(B), y_(A) and y_(B) are derived as:

X _(a)=(x ⁰ _(A) +x ¹ _(A)+1)>>1;X _(b)=(x ₀ ^(B) +x ¹ _(B)+1)>>1;Y_(a)=(y ⁰ _(A) +y ₁ ^(A)+1)>>1;Y _(b)=(y ⁰ _(B) +y ¹ _(B)+1)>>1  (2-2)

Finally, the linear model parameters α and β are obtained according tothe following equations.

$\begin{matrix}{\alpha = \frac{Y_{a} - Y_{b}}{X_{a} - X_{b}}} & \left( {2 - 3} \right)\end{matrix}$ $\begin{matrix}{\beta = {Y_{b} - {\alpha \cdot X_{b}}}} & \left( {2 - 4} \right)\end{matrix}$

The division operation to calculate parameter α is implemented with alook-up table. To reduce the memory required for storing the table, thediff value (difference between maximum and minimum values) and theparameter α are expressed by an exponential notation. For example, diffis approximated with a 4-bit significant part and an exponent.Consequently, the table for 1/cliff is reduced into 16 elements for 16values of the significand as follows:

DivTable[ ]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0}  (2-5)

This would have a benefit of both reducing the complexity of thecalculation as well as the memory size required for storing the neededtables.

To match the chroma sample locations for 4:2:0 video sequences, twotypes of downsampling filter are applied to luma samples to achieve 2 to1 downsampling ratio in both horizontal and vertical directions. Theselection of downsampling filter is specified by a sequence parameterset (SPS) level flag. The two downsampling filters are as follows, whichare corresponding to “type-0” and “type-2” content, respectively.

$\begin{matrix}{{{rec}_{L}^{\prime}\left( {i,j} \right)} = {\begin{bmatrix}{{{rec}_{L}\left( {{{2i} - 1},{{2j} - 1}} \right)} + {2 \cdot {{rec}_{L}\left( {{{2i} - 1},{{2j} - 1}} \right)}} + {{rec}_{L}\left( {{{2i} + 1},{{2j} - 1}} \right)} +} \\{{{rec}_{L}\left( {{{2i} - 1},{2j}} \right)} + {2 \cdot {{rec}_{L}\left( {{2i},{2j}} \right)}} + {{rec}_{L}\left( {{{2i} + 1},{2j}} \right)} + 4}\end{bmatrix} \gg 3}} & \left( {2 - 6} \right)\end{matrix}$ $\begin{matrix}{{{rec}_{L}^{\prime}\left( {i,j} \right)} = {\begin{bmatrix}{{re{c_{L}\left( {{2i},{{2j} - 1}} \right)}} + {re{c_{L}\left( {{{2i} - 1},{2j}} \right)}} + {4 \cdot {{rec}_{L}\left( {{2i},{2j}} \right)}} +} \\{{{re}{c_{L}\left( {{{2i} + 1},{2j}} \right)}} + {re{c_{L}\left( {{2i},{{2j} + 1}} \right)}} + 4}\end{bmatrix} \gg 3}} & \left( {2 - 7} \right)\end{matrix}$

Note that only one luma line (general line buffer in intra prediction)is used to make the downsampled luma samples when the upper referenceline is at the CTU boundary.

This parameter computation is performed as part of the decoding process,and not just as an encoder search operation. As a result, no syntax isused to convey the α and β values to the decoder.

For chroma intra mode coding, a total of 8 intra modes are allowed forchroma intra mode coding. Those modes include five traditional intramodes and three cross-component linear model modes (LM, LM_A, and LM_L).Chroma mode signalling and derivation process are shown in Table 2-2.Chroma mode coding directly depends on the intra prediction mode of thecorresponding luma block. Since separate block partitioning structurefor luma and chroma components is enabled in I slices, one chroma blockmay correspond to multiple luma blocks. Therefore, for Chroma derivedmode (DM), the intra prediction mode of the corresponding luma blockcovering the center position of the current chroma block is directlyinherited.

TABLE 2-2 Derivation of chroma prediction mode from luma mode whencclm_is enabled Corresponding luma intra prediction mode Chroma Xprediction mode 0 50 18 1 ( 0 <= X <= 66 ) 0 66 0 0 0 0 1 50 66 50 50 502 18 18 66 18 18 3 1 1 1 66 1 4 81 81 81 81 81 5 82 82 82 82 82 6 83 8383 83 83 7 0 50 18 1 X

Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM IntraPrediction Mode in JVET-Q2001-vE

8.4.5.2.13Inputs to this process are:

-   -   the intra prediction mode predModeIntra,    -   a sample location (xTbC, yTbC) of the top-left sample of the        current transform block relative to the top-left sample of the        current picture,    -   a variable nTbW specifying the transform block width,    -   a variable nTbH specifying the transform block height,    -   a variable cIdx specifying the colour component of the current        block,    -   chroma neighbouring samples p[x][y], with x=−1, y=0 . . .        2*nTbH−1 and x=0 . . . 2*nTbW−1, y=−1.        Output of this process are predicted samples predSamples[x][y],        with x=0 . . . nTbW−1, y=0 . . . nTbH−1.        The current luma location (xTbY, yTbY) is derived as follows:

(xTbY,yTbY)=(xTbC<<(SubWidthC−1),yTbC<<(SubHeightC−1))  (351)

The variables availL, availT and availTL are derived as follows:

-   -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY−1, yTbY), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availL.    -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY, yTbY−1), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availT.    -   The variable availTL is derived as follows:

availTL=availL&&availT  (352)

-   -   The number of available top-right neighbouring chroma samples        numTopRight is derived as follows:        -   The variable numTopRight is set equal to 0 and availTR is            set equal to TRUE.        -   When predModeIntra is equal to INTRA_T_CCLM, the following            applies for x=nTbW . . . 2*nTbW−1 until availTR is equal to            FALSE or x is equal to 2*nTbW−1:            -   The derivation process for neighbouring block                availability as specified in clause 6.4.4 is invoked                with the current luma location (xCurr, yCurr) set equal                to (xTbY, yTbY) the neighbouring luma location (xTbY+x,                yTbY−1), checkPredModeY set equal to FALSE, and cIdx as                inputs, and the output is assigned to availTR            -   When availTR is equal to TRUE, numTopRight is                incremented by one.    -   The number of available left-below neighbouring chroma samples        numLeftBelow is derived as follows:        -   The variable numLeftBelow is set equal to 0 and availLB is            set equal to TRUE.        -   When predModeIntra is equal to INTRA_L_CCLM, the following            applies for y=nTbH . . . 2*nTbH−1 until availLB is equal to            FALSE or y is equal to 2*nTbH−1:            -   The derivation process for neighbouring block                availability as specified in clause 6.4.4 is invoked                with the current luma location (xCurr, yCurr) set equal                to (xTbY, yTbY), the neighbouring luma location (xTbY−1,                yTbY+y), checkPredModeY set equal to FALSE, and cIdx as                inputs, and the output is assigned to availLB            -   When availLB is equal to TRUE, numLeftBelow is                incremented by one.                The number of available neighbouring chroma samples on                the top and top-right numSampT and the number of                available neighbouring chroma samples on the left and                left-below numSampL are derived as follows:    -   If predModeIntra is equal to INTRA_LT_CCLM, the following        applies:

numSampT=availT?nTbW:0  (353)

numSampL=availL?nTbH:0  (354)

-   -   Otherwise, the following applies:

numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0  (355)

numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0  (356)

The variable bCTUboundary is derived as follows:

bCTUboundary=(yTbY&(CtbSizeY−1)==0)?TRUE:FALSE.  (357)

The variable cntN and array pickPosN with N being replaced by L and T,are derived as follows:

-   -   The variable numIs4N is derived as follows:

numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1)  (358)

-   -   The variable startPosN is set equal to numSampN>>(2+numIs4N).    -   The variable pickStepN is set equal to Max(1,        numSampN>>(1+numIs4N)).    -   If availN is equal to TRUE and predModeIntra is equal to        INTRA_LT_CCLM or INTRA_N_CCLM, the following assignments are        made:        -   cntN is set equal to Min(numSampN, (1+numIs4N)<<1).        -   pickPosN[pos] is set equal to (startPosN+pos*pickStepN),            with pos=0 . . . cntN−1.    -   Otherwise, cntN is set equal to 0.        The prediction samples predSamples[x][y] with x=0 . . . nTbW−1,        y=0 . . . nTbH−1 are derived as follows:    -   If both numSampL and numSampT are equal to 0, the following        applies:

predSamples[x][y]=1<<(BitDepth−1)  (359)

-   -   Otherwise, the following ordered steps apply:        -   1. The collocated luma samples pY[x][y] with x=0 . . .            nTbW*SubWidthC−1, y=0 . . . nTbH*SubHeightC−1 are set equal            to the reconstructed luma samples prior to the deblocking            filter process at the locations (xTbY+x, yTbY+y).        -   2. The neighbouring luma samples pY[x][y] are derived as            follows:            -   When numSampL is greater than 0, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=0 . . .                SubHeightC*numSampL−1, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availT is equal to FALSE, the neighbouring top luma                samples pY[x][y] with x=−1 . . . SubWidthC*numSampT−1,                y=−1 . . . −2, are set equal to the luma samples                pY[x][0].            -   When availL is equal to FALSE, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=−1 . . .                SubHeightC*numSampL−1, are set equal to the luma samples                pY[0][y].            -   When numSampT is greater than 0, the neighbouring top                luma samples pY[x][y] with x=0 . . .                SubWidthC*numSampT−1, y=−1, −2, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availTL is equal to TRUE, the neighbouring top-left                luma samples pY[x][y] with x=−1, y=−1, −2, are set equal                to the reconstructed luma samples prior to the                deblocking filter process at the locations (xTbY+x,                yTbY+y).        -   3. The down-sampled collocated luma samples pDsY[x][y] with            x=0 . . . nTbW−1, y=0 . . . nTbH−1 are derived as follows:            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:                -   pDsY[x][y] with x=1 . . . nTbW−1, y=1 . . . nTbH−1                    is derived as follows:

pDstY[x][y]=pY[x][y]  (360)

-   -   -   -   Otherwise, the following applies:                -   The one-dimensional filter coefficients array F1 and                    F2, and the 2-dimensional filter coefficients arrays                    F3 and F4 are specified as follows.

F1[0]=2,F1[1]=0  (361)

F2[0]=1,F2[1]=2,F2[2]=1  (362)

F3[i][j]=F4[i][j]=0,with i=0 . . . 2,j=0 . . . 2  (363)

-   -   -   -   -    If both SubWidthC and SubHeightC are equal to 2,                    the following applies:

F1[0]=1,F1[1]=1  (364)

F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1  (365)

F4[0][1]=1,F4[1][1]=2,F4[2][1]=1  (366)

F4[0][2]=1,F4[1][2]=2,F4[2][2]=1  (367)

-   -   -   -   -    Otherwise, the following applies:

F3[1][1]=8  (368)

F4[0][1]=2,F4[1][1]=4,F4[2][1]=2,  (369)

-   -   -   -   -   If sps_chroma_vertical_collocated_flag is equal to                    1, the following applies:                -    pDsY[x][y] with x=0 . . . nTbW−1, y=0 . . . nTbH−1                    is derived as follows:

pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y−1]+F3[0][1]*pY[SubWidthC*x−1][SubHeightC*y]+F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3  (370)

-   -   -   -   -   Otherwise (sps_chroma_vertical_collocated_flag is                    equal to 0), the following applies:                -    pDsY[x][y] with x=0 . . . nTbW−1, y=0 . . . nTbH−1                    is derived as follows:

pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x−1][SubHeightC*y]+F4[0][2]*pY[SubWidthC*x−1][SubHeightC*y+1]+F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3  (371)

-   -   -   4. When numSampL is greater than 0, the selected            neighbouring left chroma samples pSelC[idx] are set equal to            p[−1][pickPosL[idx]] with idx=0 . . . cntL−1, and the            selected down-sampled neighbouring left luma samples            pSelDsY[idx] with idx=0 . . . cntL−1 are derived as follows:            -   The variable y is set equal to pickPosL[idx].            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:

pSelDsY[idx]=pY[−1][y]  (372)

-   -   -   -   Otherwise the following applies:                -   If sps_chroma_vertical_collocated_flag is equal to                    1, the following applies:

pSelDsY[idx]=(F3[1][0]*pY[−SubWidthC][SubHeightC*y−1]+F3[0][1]*pY[−1−SubWidthC][SubHeightC*y]+F3[1][1]*pY[−SubWidthC][SubHeightC*y]+F3[2][1]*pY[1−SubWidthC][SubHeightC*y]+F3[1][2]*pY[−SubWidthC][SubHeightC*y+1]+4)>>3  (373)

-   -   -   -   -   Otherwise (sps_chroma_vertical_collocated_flag is                    equal to 0), the following applies:

pSelDsY[idx]=(F4[0][1]*pY[−1−SubWidthC][SubHeightC*y]+F4[0][2]*pY[−1−SubWidthC][SubHeightC*y+1]+F4[1][1]*pY[−SubWidthC][SubHeightC*y]+F4[1][2]*pY[−SubWidthC][SubHeightC*y+1]+F4[2][1]*pY[1−SubWidthC][SubHeightC*y]+F4[2][2]*pY[1−SubWidthC][SubHeightC*y+1]+4)>>3  (374)

-   -   -   5. When numSampT is greater than 0, the selected            neighbouring top chroma samples pSelC[idx] are set equal to            p[pickPosT[idx−cntL]][−1] with idx=cntL . . . cntL+cntT−1,            and the down-sampled neighbouring top luma samples            pSelDsY[idx] with idx=0 . . . cntL+cntT−1 are specified as            follows:            -   The variable x is set equal to pickPosT[idx−cntL].            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:

pSelDsY[idx]=pY[x][−1]  (375)

-   -   -   -   Otherwise, the following applies:                -   If sps_chroma_vertical_collocated_flag is equal to                    1, the following applies:                -    If bCTUboundary is equal to FALSE, the following                    applies:

pSelDsY[idx]=(F3[1][0]*pY[SubWidthC*x][−1−SubHeightC]+F3[0][1]*pY[SubWidthC*x−1][−SubHeightC]+F3[1][1]*pY[SubWidthC*x][−SubHeightC]+F3[2][1]*pY[SubWidthC*x+1][−SubHeightC]+F3[1][2]*pY[SubWidthC*x][1−SubHeightC]+4)>>3  (376)

-   -   -   -   -    Otherwise (bCTUboundary is equal to TRUE), the                    following applies:

pSelDsY[idx]=(F2[0]*pY[SubWidthC*x−1][−1]+F2[1]*pY[SubWidthC*x][−1]+F2[2]*pY[SubWidthC*x+1][−1]+2)>>2  (377)

-   -   -   -   -   Otherwise (sps_chroma_vertical_collocated_flag is                    equal to 0), the following applies:                -    If bCTUboundary is equal to FALSE, the following                    applies:

pSelDsY[idx]=(F4[0][1]*pY[SubWidthCx−1][−1]+F4[0][2]*pY[SubWidthC*x−1][−2]+F4[1][1]*pY[SubWidthC*x][−1]+F4[1][2]*pY[SubWidthC*x][−2]+F4[2][1]*pY[SubWidthC*x+1][−1]+F4[2][2]*pY[SubWidthC*x+1][−2]+4)>>3  (378)

-   -   -   -   -    Otherwise (bCTUboundary is equal to TRUE), the                    following applies:

pSelDsY[idx]=(F2[0]*pY[SubWidthC*x−1][−1]+F2[1]*pY[SubWidthC*x][−1]+F2[2]*pY[SubWidthC*x+1][−1]+2)>>2  (379)

-   -   -   6. When cntT+cntL is not equal to 0, the variables minY,            maxY, minC and maxC are derived as follows:            -   When cntT+cntL is equal to 2, pSelComp[3] is set equal                to pSelComp[0], pSelComp[2] is set equal to pSelComp[1],                pSelComp[0] is set equal to pSelComp[1], and pSelComp[1]                is set equal to pSelComp[3], with Comp being replaced by                DsY and C.            -   The arrays minGrpIdx and maxGrpIdx are derived as                follows:

minGrpIdx[0]=0  (380)

minGrpIdx[1]=2  (381)

maxGrpIdx[0]=1  (382)

maxGrpIdx[1]=3  (383)

When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[minGrpIdx[1]],minGrpIdx[0] and minGrpIdx[1] are swapped as follows:

(minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1])  (384)

-   -   -   -   When pSelDsY[maxGrpIdx[0]] is greater than                pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are                swapped as follows:

(maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1])  (385)

-   -   -   -   When pSelDsY[minGrpIdx[0]] is greater than                pSelDsY[maxGrpIdx[1]], arrays minGrpIdx and maxGrpIdx                are swapped as follows:

(minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx)  (386)

-   -   -   -   When pSelDsY[minGrpIdx[1]] is greater than                pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are                swapped as follows:

(minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0])  (387)

-   -   -   -   The variables maxY, maxC, minY and minC are derived as                follows:

maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1  (388)

maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1  (389)

minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1  (390)

minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1  (391)

-   -   -   7. The variables a, b, and k are derived as follows:            -   If numSampL is equal to 0, and numSampT is equal to 0,                the following applies:

k=0  (392)

a=0  (393)

b=1<<(BitDepth−1)  (394)

-   -   -   -   Otherwise, the following applies:

diff=maxY−minY  (395)

-   -   -   -   -    If diff is not equal to 0, the following applies:

diffC=maxC−minC  (396)

x=Floor(Log 2(diff))  (397)

normDiff=((diff<<4)>>x)&15  (398)

x+=(normDiff!=0)?1:0  (399)

y=Abs(diffC)>0?Floor(Log 2(Abs(diffC)))+1:0  (400)

a=(diffC*(divSigTable[normDiff]|8)+2^(y-1))>>y  (401)

k=((3+x−y)<1)?1:3+x−y  (402)

a=((3+x−y)<1)?Sign(a)*15:a  (403)

b=minC−((a*minY)>>k)  (404)

-   -   -   -   -    where divSigTable[ ] is specified as follows:

divSigTable[ ]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0}  (405)

-   -   -   -   -    Otherwise (diff is equal to 0), the following                    applies:

k=0  (406)

a=0  (407)

b=minC  (408)

-   -   -   8. The prediction samples predSamples[x][y] with x=0 . . .            nTbW−1, y=0 . . . nTbH−1 are derived as follows:

predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b)  (409)

-   -   NOTE—This process uses sps_chroma_vertical_collocated_flag.        However, in order to simplify implementation, it does not use        sps_chroma_horizontal_collocated_flag.

2.8. Block Differential Pulse-Code Modulation Coding (BDPCM)

BDPCM is proposed in WET-M0057. Due to the shape of the horizontal(resp. vertical) predictors, which use the left (A) (resp. top (B))pixel for prediction of the current pixel, the most throughput-efficientway of processing the block is to process all the pixels of one column(resp. line) in parallel, and to process these columns (resp. lines)sequentially. In order to increase throughput, we introduce thefollowing process: a block of width 4 is divided into two halves with ahorizontal frontier when the predictor chosen on this block is vertical,and a block of height 4 is divided into two halves with a verticalfrontier when the predictor chosen on this block is horizontal.

When a block is divided, samples from one area are not allowed to usepixels from another area to compute the prediction: if this situationoccurs, the prediction pixel is replaced by the reference pixel in theprediction direction. This is shown in FIG. 5 for different positions ofcurrent pixel X in a 4×8 block predicted vertically.

FIG. 5 shows example of dividing a block of 4×8 samples into twoindependently decodable areas.

Thanks to this property, it becomes now possible to process a 4×4 blockin 2 cycles, and a 4×8 or 8×4 block in 4 cycles, and so on, as shown onFIG. 6 .

FIG. 6 shows an example order of processing of the rows of pixels tomaximize throughput for 4×N blocks with vertical predictor.

Table 2-3 summarizes the number of cycles required to process the block,depending on the block size. It is trivial to show that any block whichhas both dimensions larger or equal to 8 can be processed in 8 pixelsper cycle or more.

TABLE 2-3 Worst case throughput for blocks of size 4 × N, N × 4 Blocksize 4 × 4 4 × 8, 8 × 4 4 × 16, 16 × 4 4 × 32, 32 × 4 Cycles 2 4 8 16Pixels 16 32 64 128 Throughput 8 8 8 8 (pixels/cycle)

2.9. Quantized Residual Domain BDPCM

In JVET-N0413, quantized residual domain BDPCM (denote as RBDPCMhereinafter) is proposed. The intra prediction is done on the entireblock by sample copying in prediction direction (horizontal or verticalprediction) similar to intra prediction. The residual is quantized andthe delta between the quantized residual and its predictor (horizontalor vertical) quantized value is coded.

For a block of size M (rows)×N (cols), let r_(i,j), 0≤i≤M−1, 0≤j≤N−1 bethe prediction residual after performing intra prediction horizontally(copying left neighbour pixel value across the predicted block line byline) or vertically (copying top neighbour line to each line in thepredicted block) using unfiltered samples from above or left blockboundary samples. Let Q(r_(i,j)), 0≤i≤M−1, 0≤j≤N−1 denote the quantizedversion of the residual r_(i,j), where residual is difference betweenoriginal block and the predicted block values. Then the block DPCM isapplied to the quantized residual samples, resulting in modified M×Narray {tilde over (R)} with elements {tilde over (r)}_(i,j). Whenvertical BDPCM is signalled:

$\begin{matrix}{{\overset{˜}{r}}_{i,j} = \left\{ {\begin{matrix}{{Q\left( r_{i,j} \right)},} & {{i = 0},{0 \leq j \leq \left( {N - 1} \right)}} \\{{{Q\left( r_{i,j} \right)} - {Q\left( r_{{({i - 1})},j} \right)}},} & {{1 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq \left( {N - 1} \right)}}\end{matrix}.} \right.} & \left( {2 - 8} \right)\end{matrix}$

For horizontal prediction, similar rules apply, and the residualquantized samples are obtained by

$\begin{matrix}{{\overset{˜}{r}}_{i,j} = \left\{ {\begin{matrix}{{Q\left( r_{i,j} \right)},} & {{0 \leq i \leq \left( {M - 1} \right)},{j = 0}} \\{{{Q\left( r_{i,j} \right)} - {Q\left( r_{i,{({j - 1})}} \right)}},} & {{0 \leq i \leq \left( {M - 1} \right)},{1 \leq j \leq \left( {N - 1} \right)}}\end{matrix}.} \right.} & \left( {2 - 9} \right)\end{matrix}$

The residual quantized samples {tilde over (r)}_(i,j) are sent to thedecoder.

On the decoder side, the above calculations are reversed to produceQ(r_(i,j)), 0≤i≤M−1, 0≤j≤N−1. For vertical prediction case,

Q(r _(i,j))=Σ_(k=0) ^(i) {tilde over (r)}_(k,j),0≤i≤(M−1),0≤j≤(N−1).  (2-10)

For horizontal case,

Q(r _(i,j))=Σ_(k=0) ^(j) {tilde over (r)}_(i,k),0≤i≤(M−1),0≤j≤(N−1).  (2-11)

The inverse quantized residuals, Q⁻¹ (Q(r_(i,j))), are added to theintra block prediction values to produce the reconstructed samplevalues.

The main benefit of this scheme is that the invert DPCM can be done onthe fly during coefficient parsing simply adding the predictor as thecoefficients are parsed or it can be performed after parsing.

Transform skip is always used in quantized residual domain BDPCM.

2.10. Multiple Transform Set (MTS) in VVC

In VTM, large block-size transforms, up to 64×64 in size, are enabled,which is primarily useful for higher resolution video, e.g., 1080p and4K sequences. High frequency transform coefficients are zeroed out forthe transform blocks with size (width or height, or both width andheight) equal to 64, so that only the lower-frequency coefficients areretained. For example, for an M×N transform block, with M as the blockwidth and N as the block height, when M is equal to 64, only the left 32columns of transform coefficients are kept. Similarly, when N is equalto 64, only the top 32 rows of transform coefficients are kept. Whentransform skip mode is used for a large block, the entire block is usedwithout zeroing out any values. The VTM also supports configurable maxtransform size in SPS, such that encoder has the flexibility to chooseup to 16-length, 32-length or 64-length transform size depending on theneed of specific implementation.

In addition to Discrete Cosine Transform (DCT)-II which has beenemployed in HEVC, a Multiple Transform Selection (MTS) scheme is usedfor residual coding both inter and intra coded blocks. It uses multipleselected transforms from the DCT8/Discrete Sine Transform (DST)7. Thenewly introduced transform matrices are DST-VII and DCT-VIII. Table 2-4shows the basis functions of the selected DST/DCT.

TABLE 2-4 Transform basis functions of DCT-II/ VIII and DSTVII forN-point input Transform Type Basis function T_(i)(j), i, j = 0, 1, . . ., N-1 DCT-II${T_{i}(j)} = {{\omega_{0} \cdot \sqrt{\frac{2}{N}} \cdot \cos}\left( \frac{\pi \cdot i \cdot \left( {{2j} + 1} \right)}{2N} \right)}$${where},{\omega_{0} = \left\{ \begin{matrix}\sqrt{\frac{2}{N}} & {i = 0} \\1 & {i \neq 0}\end{matrix} \right.}$ DCT-VIII${T_{i}(j)} = {{\sqrt{\frac{4}{{2N} + 1}} \cdot \cos}\left( \frac{\pi \cdot \left( {{2i} + 1} \right) \cdot \left( {{2j} + 1} \right)}{{4N} + 2} \right)}$DST-VII${T_{i}(j)} = {{\sqrt{\frac{4}{{2N} + 1}} \cdot \sin}\left( \frac{\pi \cdot \left( {{2i} + 1} \right) \cdot \left( {j + 1} \right)}{{2N} + 1} \right)}$

In order to keep the orthogonality of the transform matrix, thetransform matrices are quantized more accurately than the transformmatrices in HEVC. To keep the intermediate values of the transformedcoefficients within the 16-bit range, after horizontal and aftervertical transform, all the coefficients are to have 10-bit.

In order to control multi transform selection (MT S) scheme, separateenabling flags are specified at SPS level for intra and inter,respectively. When MTS is enabled at SPS, a CU level flag is signalledto indicate whether MTS is applied or not. Here, MTS is applied only forluma. The MTS CU level flag is signalled when the following conditionsare satisfied.

-   -   Both width and height smaller than or equal to 32    -   CBF flag is equal to one

If MTS CU flag is equal to zero, then DCT2 is applied in bothdirections. However, if MTS CU flag is equal to one, then two otherflags are additionally signalled to indicate the transform type for thehorizontal and vertical directions, respectively. Transform andsignalling mapping table as shown in Table 2-5. Unified the transformselection for intra sub-partitions (ISP) and implicit MTS is used byremoving the intra-mode and block-shape dependencies. If current blockis ISP mode or if the current block is intra block and both intra andinter explicit MTS is on, then only DST7 is used for both horizontal andvertical transform cores. When it comes to transform matrix precision,8-bit primary transform cores are used. Therefore, all the transformcores used in HEVC are kept as the same, including 4-point DCT-2 andDST-7, 8-point, 16-point and 32-point DCT-2. Also, other transform coresincluding 64-point DCT-2, 4-point DCT-8, 8-point, 16-point, 32-pointDST-7 and DCT-8, use 8-bit primary transform cores.

TABLE 2-5 Transform and signalling mapping table MTS_CU_ MTS_Hor_MTS_Ver_ Intra/inter flag flag flag Horizontal Vertical 0 DCT2 1 0 0DST7 DST7 0 1 DCT8 DST7 1 0 DST7 DCT8 1 1 DCT8 DCT8

To reduce the complexity of large size DST-7 and DCT-8, High frequencytransform coefficients are zeroed out for the DST-7 and DCT-8 blockswith size (width or height, or both width and height) equal to 32. Onlythe coefficients within the 16×16 lower-frequency region are retained.

As in HEVC, the residual of a block can be coded with transform skipmode. To avoid the redundancy of syntax coding, the transform skip flagis not signalled when the CU level MTS_CU_flag is not equal to zero. Theblock size limitation for transform skip is the same to that for MTS inJEM4, which indicate that transform skip is applicable for a CU whenboth block width and height are equal to or less than 32. Note thatimplicit MTS transform is set to DCT2 when LFNST or Matrix-BasedIntra-Picture Prediction (MIP) is activated for the current CU. Also,the implicit MTS can be still enabled when MTS is enabled for intercoded blocks.

2.11. Low-Frequency Non-Separable Transform (LFNST)

In VVC, LFNST (low-frequency non-separable transform), which is known asreduced secondary transform, is applied between forward primarytransform and quantization (at encoder) and between de-quantization andinverse primary transform (at decoder side) as shown in FIG. 7 . InLFNST, 4×4 non-separable transform or 8×8 non-separable transform isapplied according to block size. For example, 4×4 LFNST is applied forsmall blocks (i.e., min (width, height)<8) and 8×8 LFNST is applied forlarger blocks (i.e., min (width, height)>4).

FIG. 7 shows an example of a low-Frequency Non-Separable Transform(LFNST) process.

Application of a non-separable transform, which is being used in LFNST,is described as follows using input as an example. To apply 4×4 LFNST,the 4×4 input block X

$\begin{matrix}{X = \begin{bmatrix}X_{00} & X_{01} & X_{02} & X_{03} \\X_{10} & X_{11} & X_{12} & X_{13} \\X_{20} & X_{21} & X_{22} & X_{23} \\X_{30} & X_{31} & X_{32} & X_{33}\end{bmatrix}} & \left( {2 - 12} \right)\end{matrix}$

is first represented as a vector

:

=[X ₀₀ X ₀₁ X ₀₂ X ₀₃ X ₁₀ X ₁₁ X ₁₂ X ₁₃ X ₂₀ X ₂₁ X ₂₂ X ₂₃ X ₃₀ X ₃₁X ₃₂ X ₃₃]^(T)  (2-13)

The non-separable transform is calculated as

=T·

, where

indicates the transform coefficient vector, and T is a 16×16 transformmatrix. The 16×1 coefficient vector

is subsequently re-organized as 4×4 block using the scanning order forthat block (horizontal, vertical or diagonal). The coefficients withsmaller index will be placed with the smaller scanning index in the 4×4coefficient block.

2.11.1. Reduced Non-Separable Transform

LFNST (low-frequency non-separable transform) is based on direct matrixmultiplication approach to apply non-separable transform so that it isimplemented in a single pass without multiple iterations. However, thenon-separable transform matrix dimension needs to be reduced to minimizecomputational complexity and memory space to store the transformcoefficients. Hence, reduced non-separable transform (or RST) method isused in LFNST. The main idea of the reduced non-separable transform isto map an N (N is commonly equal to 64 for 8×8 NSST) dimensional vectorto an R dimensional vector in a different space, where N/R (R<N) is thereduction factor. Hence, instead of N×N matrix, RST matrix becomes anR×N matrix as follows:

$\begin{matrix}{T_{R \times N} = \begin{bmatrix}t_{11} & t_{12} & t_{13} & \ldots & t_{1N} \\t_{21} & t_{22} & t_{23} & & t_{2N} \\ & \vdots & & \ddots & \vdots \\t_{R1} & t_{R2} & t_{R3} & \ldots & t_{RN}\end{bmatrix}} & \left( {2 - 14} \right)\end{matrix}$

where the R rows of the transform are R bases of the N dimensionalspace. The inverse transform matrix for RT is the transpose of itsforward transform. For 8×8 LFNST, a reduction factor of 4 is applied,and 64×64 direct matrix, which is conventional 8×8 non-separabletransform matrix size, is reduced to 16×48 direct matrix. Hence, the48×16 inverse RST matrix is used at the decoder side to generate core(primary) transform coefficients in 8×8 top-left regions. When 16×48matrices are applied instead of 16×64 with the same transform setconfiguration, each of which takes 48 input data from three 4×4 blocksin a top-left 8×8 block excluding right-bottom 4×4 block. With the helpof the reduced dimension, memory usage for storing all LFNST matrices isreduced from 10 KB to 8 KB with reasonable performance drop. In order toreduce complexity LFNST is restricted to be applicable only if allcoefficients outside the first coefficient sub-group arenon-significant. Hence, all primary-only transform coefficients have tobe zero when LFNST is applied. This allows a conditioning of the LFNSTindex signalling on the last-significant position, and hence avoids theextra coefficient scanning in the current LFNST design, which is neededfor checking for significant coefficients at specific positions only.The worst-case handling of LFNST (in terms of multiplications per pixel)restricts the non-separable transforms for 4×4 and 8×8 blocks to 8×16and 8×48 transforms, respectively. In those cases, the last-significantscan position has to be less than 8 when LFNST is applied, for othersizes less than 16. For blocks with a shape of 4×N and N×4 and N>8, theproposed restriction implies that the LFNST is now applied only once,and that to the top-left 4×4 region only. As all primary-onlycoefficients are zero when LFNST is applied, the number of operationsneeded for the primary transforms is reduced in such cases. From encoderperspective, the quantization of coefficients is remarkably simplifiedwhen LFNST transforms are tested. A rate-distortion optimizedquantization has to be done at maximum for the first 16 coefficients (inscan order), the remaining coefficients are enforced to be zero.

2.11.2. LFNST Transform Selection

There are totally 4 transform sets and 2 non-separable transformmatrices (kernels) per transform set are used in LFNST. The mapping fromthe intra prediction mode to the transform set is pre-defined as shownin Table 2-6. If one of three CCLM modes (INTRA_LT_CCLM, INTRA_T_CCLM orINTRA_L_CCLM) is used for the current block (81<=predModeIntra<=83),transform set 0 is selected for the current chroma block. For eachtransform set, the selected non-separable secondary transform candidateis further specified by the explicitly signalled LFNST index. The indexis signalled in a bit-stream once per Intra CU after transformcoefficients.

TABLE 2-6 Transform selection table Tr. set IntraPredMode indexIntraPredMode < 0 1  0 <= IntraPredMode <= 1 0  2 <= IntraPredMode <= 121 13 <= IntraPredMode <= 23 2 24 <= IntraPredMode <= 44 3 45 <=IntraPredMode <= 55 2 56 <= IntraPredMode <= 80 1 81 <= IntraPredMode <=83 02.11.3. LFNST Index Signalling and Interaction with Other Tools

Since LFNST is restricted to be applicable only if all coefficientsoutside the first coefficient sub-group are non-significant, LFNST indexcoding depends on the position of the last significant coefficient. Inaddition, the LFNST index is context coded but does not depend on intraprediction mode, and only the first bin is context coded. Furthermore,LFNST is applied for intra CU in both intra and inter slices, and forboth Luma and Chroma. If a dual tree is enabled, LFNST indices for Lumaand Chroma are signalled separately. For inter slice (the dual tree isdisabled), a single LFNST index is signalled and used for both Luma andChroma.

When ISP mode is selected, LFNST is disabled and RST index is notsignalled, because performance improvement was marginal even if RST isapplied to every feasible partition block. Furthermore, disabling RSTfor ISP-predicted residual could reduce encoding complexity. LFNST isalso disabled and the index is not signalled when MIP mode is selected.

Considering that a large CU greater than 64×64 is implicitly split (TUtiling) due to the existing maximum transform size restriction (64×64),an LFNST index search could increase data buffering by four times for acertain number of decode pipeline stages. Therefore, the maximum sizethat LFNST is allowed is restricted to 64×64. Note that LFNST is enabledwith DCT2 only.

2.12. Transform Skip for Chroma

Chroma transform skip (TS) is introduced in VVC. The motivation is tounify TS and MTS signalling between luma and chroma by relocatingtransform_skip_flag and mts_idx into residual_coding part. One contextmodel is added for chroma TS. No context model and no binarization arechanged for the mts_idx. In addition, TS residual coding is also appliedwhen chroma TS is used.

Semantics

transform_skip_flag[x0][y0][cIdx] specifies whether a transform isapplied to the associated transform block or not. The array indices x0,y0 specify the location (x0, y0) of the top-left luma sample of theconsidered transform block relative to the top-left luma sample of thepicture. transform_skip_flag[x0][y0][cIdx] equal to 1 specifies that notransform is applied to the current transform block. The array indexcIdx specifies an indicator for the colour component; it is equal to 0for luma, equal to 1 for Cb and equal to 2 for Cr.transform_skip_flag[x0][y0][cIdx] equal to 0 specifies that the decisionwhether transform is applied to the current transform block or notdepends on other syntax elements. When transform_skip_flag[x0][y0][cIdx]is not present, it is inferred to be equal to 0.

2.13. BDPCM for Chroma

In addition to chroma TS support, BDPCM is added to chroma components.If sps_bdpcm_enable_flag is 1, a further syntax elementsps_bdpcm_chroma_enable_flag is added to the SPS. The flags have thefollowing behaviour, as indicated in Table 2-7.

TABLE 2-7 sps flags for luma and chroma BDPCM sps_bdpcm_sps_bdpcm_chroma_ enable_flag enable_flag behaviour 0 not written BPDCMis not used in the sequence 1 0 BDPCM is available for luma only 1 1BDPCM is available for luma and chroma

When BDPCM is available for luma only, the current behaviour isunchanged. When BDPCM is also available for chroma, a bdpcm_chroma_flagis sent for each chroma block. This indicates whether BDPCM is used onthe chroma blocks. When it is on, BDPCM is used for both chromacomponents, and an additional bdpcm_dir_chroma flag is coded, indicatingthe prediction direction used for both chroma components.

The deblocking filter is de-activated on a border between two Block-DPCMblocks, since neither of the blocks uses the transform stage usuallyresponsible for blocking artifacts. This deactivation happensindependently for luma and chroma components.

3. Examples of Technical Problems Solved by the Disclosed Solutions

The current design of derivation of linear parameters in CCLM and TS hasthe following problems:

-   -   1. For the non-4:4:4 color format, the derivation of linear        parameters in CCLM involves neighbouring chroma samples and        down-sampled collocated neighbouring luma samples. As shown in        FIG. 8 , in current VVC, when the nearest line is not at the CTU        boundary, the downsampled collocated neighbouring top luma        samples are derived using the second line above current block        for 4:2:2 videos. However, for the 4:2:2 videos, the vertical        resolution is unchanged. Therefore, there is phase shift between        the downsampled collocated neighbouring top luma samples and the        neighbouring chroma samples.

FIG. 8 shows an example of neighbouring chroma samples and downsampledcollocated neighbouring luma samples used in the derivation of CCLMparameters for 4:2:2 videos.

-   -   2. In current VVC, the same maximum block size is used in the        condition check for signalling of luma transform skip flag and        signalling of chroma transform skip flag. Such a design doesn't        take the color format into consideration which is not desirable.        -   a. similar problem also exists for signalling of luma BDPCM            flag and signalling of chroma BDPCM flag wherein the same            maximum block size is used in the condition check.    -   3. In VVC as specified in JVET-Q2001-vE, left neighboring        samples are put into the selected neighbouring sample list        before the above neighboring samples. However, put the above        neighboring samples before the left neighboring samples may be        better.    -   4. In VVC as specified in JVET-Q2001-vE, two rows of        neighbouring luma samples are assigned. However, when        sps_chroma_vertical_collocated_flag is equal to 1, three rows of        neighbouring luma samples are required.    -   5. In VVC as specified in NET-Q2001-vE, when the left        neighbouring luma samples are unavailable, the left neighbouring        luma samples are padded using the left-most samples of current        block and the top-left neighbouring luma samples are padded        using the top neighbouring luma samples. However, the top        neighbouring luma samples have not been derived. For example in        JVET-Q2001-vE.        -   “When availL is equal to FALSE, the neighbouring left luma            samples pY[x][y] with x=−1 . . . −3, y=−1 . . .            SubHeightC*numSampL−1, are set equal to the luma samples            pY[0][y].        -   When numSampT is greater than 0, the neighbouring top luma            samples pY[x][y] with x=0 . . . SubWidthC*numSampT−1, y=−1,            −2, are set equal to the reconstructed luma samples prior to            the deblocking filter process at the locations (xTbY+x,            yTbY+y).”    -   6. In VVC as specified in JVET-Q2001-vE, the top (or/and left)        neighbouring luma samples are wrongly derived when they are        unavailable. For example, in NET-Q2001-vE, “When availT is equal        to FALSE, the neighbouring top luma samples pY[x][y] with x=−1 .        . . SubWidthC*numSampT−1, y=−1 . . . −2, are set equal to the        luma samples pY[x][0].” is used to derive the top neighbouring        luma samples when they are unavailable. However, numSampT has        been set equal to 0 when the top neighbouring luma samples are        unavailable.    -   7. In current VVC, the top-left neighbouring luma samples are        used in the derivation of CCLM parameters when the top and left        neighbouring luma samples are available, but the top-left        neighbouring luma samples are unavailable when they are in a        different slice, e.g. in raster-slice case.

4. A Listing of Embodiments and Techniques

The listing below should be considered as examples to explain generalconcepts. These items should not be interpreted in a narrow way.Furthermore, these items can be combined in any manner.

In this disclosure, the term ‘CCLM’ represents a coding tool thatutilizes cross-color component information to predict samples/residualsfor current color component or to derive reconstruction of samples incurrent color component. It is not limited to the CCLM technologiesdescribed in VVC.

Derivation of Linear Parameters in CCLM

-   -   1. When deriving the CCLM parameters for a chroma block, one or        multiple above neighboring lines of its collocated luma block        may be used to derive its downsampled collocated neighbouring        top luma samples.        -   a. In one example, when the current chroma block is not at            the top CTU boundary, the nearest above line of the            collocated luma block, instead of the second line above, may            be used for derivation of the downsampled collocated            neighbouring top luma samples.            -   i. In one example, one same downsampling filter may be                used for deriving the downsampled collocated                neighbouring top luma samples and the downsampled                collocated neighbouring left luma samples.                -   1) For example, [1 2 1] filter may be used. More                    specifically,                    pDsY[x]=(pY[2*x−1][−1]+2*pY[2*x][−1]+pY[2*x+1][−1]+2)>>2,                    wherein pY[2*x][−1], pY[2*x−1][−1], pY[2*x+1][−1]                    are luma samples from the nearest above neighboring                    line and pDstY[x] represents the downsampled                    collocated neighbouring top luma samples.            -   ii. In one example, different downsampling filters                (e.g., different filter taps/different filter                coefficients) may be used for deriving the downsampled                collocated neighbouring top luma samples and the                downsampled collocated neighbouring left luma samples.            -   iii. In one example, one same downsampling filter may be                used for deriving the downsampled collocated                neighbouring top luma samples regardless of the position                of the chroma block (e.g., the chroma block may be or                may not be at a top CTU boundary).            -   iv. In one example, the above methods may be only                applied to images/videos in 4:2:2 format.        -   b. In one example, when the current chroma block is not at            the top CTU boundary, above neighbouring luma samples,            including the nearest above line of the collocated luma            block, but excluding the second line above, may be used for            derivation of the downsampled collocated neighbouring top            luma samples.        -   c. In one example, the derivation of the downsampled            collocated neighbouring top luma samples may depend on            samples located at multiple lines.            -   i. In one example, it may depend on both the second                nearest line and the nearest line above the collocated                luma block.            -   ii. In one example, the downsampled collocated                neighbouring top luma samples may be derived using one                same downsampling filter for different colour formats                (e.g. 4:2:0 and 4:2:2).                -   1) In one example, 6-tap filter (e.g., [1 2 1; 1 2                    1]) may be utilized.                -    a) In one example, the downsampled collocated                    neighbouring top luma samples may be derived as:                    pDsY[x]=(pY[2*x−1][−2]+2*pY[2*x][−2]+pY[2*x+1][−2]+pY[2*x−1][−1]+2*pY[2*x][−1]+pY[2*x+1][−1]+4)>>3                    wherein pY are corresponding luma samples and                    pDstY[x] represents the downsampled collocated                    neighbouring top luma samples.                -    b) Alternatively, furthermore, the above method may                    be applied when sps_cclm_colocated_chroma_flag is                    equal to 0.                -   2) In one example, 5-tap filter (e.g., [0 1 0; 1 4                    1; 0 1 0]) may be utilized.                -    a) In one example, the downsampled collocated                    neighbouring top luma samples may be derived as:                    pDsY[x]=(pY[2*x][−2]+pY[2*x−1][−1]+4*pY[2*x][−1]+pY[2*x+1][−1]+pY[2*x][0]+4)>>3                    wherein pY are corresponding luma samples and                    pDstY[x] represents the downsampled collocated                    neighbouring top luma samples.                -    b) Alternatively, furthermore, the above method may                    be applied when sps_cclm_colocated_chroma_flag is                    equal to 1.            -   iii. In one example, the above methods may be only                applied to images/videos in 4:2:2 format.                Maximum block sizes of transform skip coded blocks                (e.g., with transform_skip_flag equal to 1, or BDPCM or                other modes that bypass transform process/use identity                transform)    -   2. Maximum block size of transform skip coded blocks may be        dependent on the colour component. Denote the maximum block size        of transform skip coded blocks for luma and chroma by MaxTsSizeY        and MaxTsSizeC, respectively.        -   a. In one example, maximum block sizes for luma and chroma            components may be different.        -   b. In one example, maximum block sizes for two chroma            components may be different.        -   c. In one example, maximum block sizes for luma and chroma            components or for each colour component may be signalled            separately.            -   i. In one example, MaxTsSizeC/MaxTsSizeY may be                signalled at sequence level/picture level/slice                level/tile group level, such as in sequence                header/picture header/SPS/video parameter set                (VPS)/dependency parameter set (DPS)/picture parameter                set (PPS)/adaptation parameter set (APS)/slice                header/tile group header.            -   ii. In one example, the MaxTsSizeY may be conditionally                signalled, such as according to transform skip is                enabled or not/BDPCM is enabled or not.            -   iii. In one example, the MaxTsSizeC may be conditionally                signalled, such as according to colour format/transform                skip is enabled or not/BDPCM is enabled or not.            -   iv. Alternatively, predictive coding between maximum                block sizes for luma and chroma components may be                utilized.        -   d. In one example, MaxTsSizeC may depend on MaxTsSizeY.            -   i. In one example, MaxTsSizeC may be set equal to                MaxTsSizeY.            -   ii. In one example, MaxTsSizeC may be set equal to                MaxTsSizeY/N (N is an integer). For example, N=2.        -   e. In one example, MaxTsSizeC may be set according to the            chroma subsampling ratios.            -   i. In one example, MaxTsSizeC is set equal to                MaxTsSizeY>>SubWidthC, wherein SubWidthC is defined in                Table 2-1.            -   ii. In one example, MaxTsSizeC is set equal to                MaxTsSizeY>>SubHeightC, wherein SubHeightC is defined in                Table 2-1.            -   iii. In one example, MaxTsSizeC is set equal to                MaxTsSizeY>>max (SubWidthC, SubHeightC).            -   iv. In one example, MaxTsSizeC is set equal to                MaxTsSizeY>>min (SubWidthC, SubHeightC).    -   3. Maximum allowed block size width and height for a transform        coded block may be defined differently.        -   a. In one example, the maximum allowed block size width and            height may be signalled separately.        -   b. In one example, the maximum allowed block size width and            height for a chroma transform coded block may be denoted as            MaxTsSizeWC and MaxTsSizeHC, respectively. MaxTsSizeWC may            be set equal to MaxTsSizeY>>SubWidthC and MaxTsSizeHC may be            set equal to MaxTsSizeY>>SubHeightC.            -   i. In one example, the MaxTsSizeY is the one defined in                bullet 2.    -   4. Whether to signal a transform skip flag for a chroma block        (e.g., transform_skip_flag[x0][y0][1] and/or        transform_skip_flag[x0][y0][2]) may depend on the maximum        allowed size for chroma transform skip coded blocks.        -   a. In one example, the chroma transform skip flag may be            conditionally signalled according to the following            conditions:            -   i. In one example, the conditions are: tbW is less than                or equal to MaxTsSizeC and tbH is less than or equal to                MaxTsSizeC, wherein tbW and tbH are the width and height                of the current chroma block.                -   1) In one example, MaxTsSizeC may be defined as that                    in bullets 2-3.            -   ii. In one example, the conditions are: tbW is less than                or equal to MaxTsSizeWC and tbH is less than or equal to                MaxTsSizeHC, wherein tbW and tbH are the width and                height of the current chroma block, MaxTsSizeWC and                MaxTsSizeHC represent the maximum allowed block size                width and height, respectively, for chroma transform                skip coded blocks.                -   1) In one example, MaxTsSizeWC and/or MaxTsSizeHC                    may be defined as that in bullet 3.        -   b. In one example, the above methods may be applicable to            the coding of chroma

BDPCM flags (e.g., intra_bdpcm_chroma_flag) by replacing ‘transformskip’ by ‘BDPCM’.

-   -   5. Instead of coding two TS flags for two chroma color        component, it is proposed to use one syntax to indicate the        usage of TS for the two chroma color components.        -   a. In one example, instead of coding            transform_skip_flag[x0][y0][1] and/or            transform_skip_flag[x0][y0][2]), a single syntax element            (e.g., TS_chroma_flag) may be coded.            -   i. In one example, the value of the single syntax                element is a binary value.                -   1) Alternatively, furthermore, the two chroma                    component blocks share the same on/off control of TS                    mode according to the single syntax element.                -    a) In one example, the value of the single syntax                    element equal to 0 indicates TS is disabled for                    both.                -    b) In one example, the value of the single syntax                    element equal to 0 indicates TS is enabled for both.                -   2) Alternatively, furthermore, a second syntax                    element may be further singled based on whether the                    value of the single syntax element is equal to K                    (e.g., K=1).                -    a) In one example, the value of the single syntax                    element equal to 0 indicates TS is disabled for                    both; the value of the single syntax element equal                    to 0 indicates TS is enabled for at least one of the                    two chroma component.                -    b) The second syntax element may be used to                    indicate TS is applied to which one of the two                    chroma components and/or TS is applied to both of                    them.            -   ii. In one example, the value of the single syntax                element is a non-binary value.                -   1) In one example, the value of the single syntax                    element equal to K0 indicates TS is disabled for                    both                -   2) In one example, the value of the single syntax                    element equal to K1 indicates TS is enabled for the                    first chroma color component and disabled for the                    second color component.                -   3) In one example, the value of the single syntax                    element equal to K2 indicates TS is disabled for the                    first chroma color component and enabled for the                    second color component.                -   4) In one example, the value of the single syntax                    element equal to K3 indicates TS is enabled for                    both.                -   5) In one example, the single syntax element may be                    coded with fixed length, unary, truncated unary,                    k-th order EG binarization methods.            -   iii. In one example, the single syntax element and/or                second syntax element may be context coded or bypass                coded.

General Claims

-   -   6. Whether to and/or how to apply the disclosed methods above        may be signalled at sequence level/picture level/slice        level/tile group level, such as in sequence header/picture        header/SP S/VP S/DP S/PPS/AP S/slice header/tile group header.    -   7. Whether to and/or how to apply the disclosed methods above        may be dependent on coded information, such as color format,        single/dual tree partitioning.

Additional Claims on CCLM

-   -   8. In the CCLM parameter derivation process, the above        neighboring samples are put into the selected neighbouring        sample list before the left neighboring samples and the selected        neighboring sample list is used to derive the CCLM parameters        (e.g., using the 4-point derivation method wherein two larger        are averaged and two smaller values are averaged, and the two        average values are used to derive the linear parameter). An        example is demonstrated in Embodiment 5.    -   9. In the CCLM parameter derivation process, when getting the        down-sampled above neighboring luma samples denoted        pSelDsY[idx], the index value idx should be in the range of cntL        to cntL+cntT−1, wherein cntL and cntT represent the number of        the left neighbouring chroma samples and above neighbouring        chroma samples used to derive the CCLM parameters, respectively.        -   a. An example is demonstrated in Embodiment 5.        -   b. Alternatively, furthermore, the left neighboring samples            are put into the selected neighbouring sample list before            the above neighboring samples.    -   10. In the CCLM parameter derivation process, three rows of        above neighbouring luma samples are assigned. An example is        demonstrated in Embodiment 6.    -   11. In the CCLM parameter derivation process, T₁ rows and T₂        columns of top-left neighbouring luma samples are assigned.        -   a. In one example, T₁=2 and T₂=2. An example is demonstrated            in Embodiment 12.        -   b. In one example, T₁=3 and T₂=3.    -   12. In the CCLM parameter derivation process, the number of rows        of above luma neighbouring samples to be assigned may depend on        a variable or a syntax element indicating whether chroma sample        positions that are not vertically shifted relative to        corresponding luma sample positions, such as        sps_chroma_vertical_collocated_flag in JVET-Q2001-vE.        -   a. In one example, three rows of above neighbouring luma            samples are assigned when            sps_chroma_vertical_collocated_flag is equal to 1.            Otherwise, two rows of above neighbouring luma samples are            assigned. The example is demonstrated in Embodiment 7.    -   13. In above examples, the neighboring luma samples could be        those before down-sampling or after down-sampling.    -   14. In the CCLM parameter derivation process, whether to and/or        how to pad the top-left neighbouring samples may depend on the        availability of at least one of the top-left neighbouring        samples, instead of the availability of the left neighbouring        samples and/or the above neighbouring samples.        -   a. In one example, the availability of at least one of the            top-left neighbouring samples may depend on whether the at            least one of the top-left neighbouring samples and samples            in the current block are in the same slice or in different            slices.            -   i. Furthermore, a slice mentioned above may be a                rectangular slice or a non-rectangular slice.        -   b. In one example, the top-left neighbouring samples are            padded if the at least one of the top-left neighbouring            samples and samples in the current block are in different            slices.        -   c. In one example, the top-left neighbouring samples are            padded if the availability of the at least one top-left            neighbouring samples is false.    -   15. In the CCLM parameter derivation process, the top-left        neighbouring luma samples may be not used when they are        “unavailable”.        -   a. In one example, a neighbouring sample is “unavailable” if            it is out of the current picture, or current sub-picture, or            current tile, or current slice, or current brick, or current            CTU, or current processing unit, or any other current video            unit.            -   i. In one example, for non-rectangular slice case shown                in FIG. 13 , the top-left neighbouring luma samples are                “unavailable” which are in a different slice from                current block.        -   b. In one example, whether to use the top-left neighbouring            luma samples in the process of CCLM may depend on whether            they are in the same            picture/sub-picture/tile/slice/brick/CTU/processing            unit/other video unit as current block.            -   i. In one example, the top-left neighbouring luma                samples may not be used in the process of CCLM when they                are in a different raster-slice from current block.                -   1) An example is demonstrated in Embodiment 10.            -   ii. In one example, the top-left neighbouring luma                samples may not be used in the process of CCLM although                they are in the same                picture/sub-picture/tile/slice/brick/CTU/processing                unit/other video unit as current block.        -   c. In the CCLM parameter derivation process, when the            top-left neighbouring luma samples are “unavailable”,            repetitive padding may be used to generate the top-left            neighbouring luma samples. Denote the top-left sample            location of the current block by (x, y). Denote the            reconstructed luma samples prior to the deblocking filter            process by pY[i][j]. Denote the padded top-left luma samples            by pD[m][n] with m=x−1 . . . x−M, n=y−1 . . . y−N, wherein M            and N are integers such as 1.            -   i. In one example, the repetitive padding method may be                used when the left or/and top neighbouring luma samples                are available.            -   ii. In one example, the top-left neighbouring luma                samples may be padded from the top neighbouring luma                samples when the top neighbouring luma samples are                available.                -   2) In one example, pD[m][n]=pY[x][n].            -   iii. In one example, the top-left neighbouring luma                samples may be padded from the left neighbouring luma                samples when the left neighbouring luma samples are                available.                -   3) In one example, pD[m][n]=pY[m][y].            -   iv. In one example, the top-left neighbouring luma                samples may be padded from the top neighbouring luma                samples when the top neighbouring luma samples are                available and the left neighbouring luma samples are                available.                -   4) In one example, pD[m][n]=pY[x][n].            -   v. Alternatively, the top-left neighbouring luma samples                may be padded from the left neighbouring luma samples                when the top neighbouring luma samples are available and                the left neighbouring luma samples are available.                -   5) In one example, pD[m][n]=pY[m][y].            -   vi. In one example, M=2, N=2, or M=3, N=3.        -   d. Alternatively, when the top-left neighbouring luma            samples are “unavailable”, they may be replaced by the            predefined values.            -   i. In one example, the predefined values may be equal to                a constant value, e.g., 128.            -   ii. In one example, the predefined values may derived                using left or/and top neighbouring luma samples.                -   6) In one example, the predefined values may equal                    to the average value of left or/and top neighbouring                    luma samples.            -   iii. In one example, the predefined values may depend on                the bit-depth of samples. For example, the predefined                values may be equal to 1<(BD−1), where BD represents the                bit-depth of samples.        -   e. Alternatively, even though the top-left neighbouring luma            samples are “available”, the above padding method in bullet            14.c and predefined values in bullet 14.d may be used to            replace the available top-left neighbouring luma samples.            -   i. An example is demonstrated in Embodiment 11.        -   f. In one example, whether to check the availability of            top-left neighbouring luma samples may depend on whether            left neighbouring luma samples are available or/and top            neighbouring luma samples are available.            -   i. In one example, check the availability of top-left                neighbouring luma samples only if both left and top                neighbouring luma samples are available. An example is                shown in Embodiment 17.        -   g. In one example, whether to and/or how to use or/and pad            the top-left neighbouring luma samples may depend on the            availability of top-left, or/and left, or/and top            neighbouring luma samples.            -   i. In one example, the top-left neighbouring luma                samples may be used only if the top-left neighbouring                luma samples are available.            -   ii. In one example, the top-left neighbouring luma                samples may be used only if the top-left, left, and top                neighbouring luma samples are available. An example is                shown in Embodiment 18.            -   iii. In one example, the top-left neighbouring luma                samples may be padded when the left and/or top                neighbouring luma samples are available.                -   1) In one example, the top-left neighbouring luma                    samples may be padded only if the left or top                    neighbouring luma samples are available, and the                    top-left neighbouring luma samples are not                    available.                -   2) In one example, the top-left neighbouring luma                    samples may be padded only if the left and top                    neighbouring luma samples are available, and the                    top-left neighbouring luma samples are not                    available.                -   3) In one example, the top-left neighbouring luma                    samples may be padded using the top neighbouring                    luma samples. The neighbouring top-left luma samples                    pY[x][y] with x=−1, −2, y=−1, −2, are set equal to                    the luma samples pY[0][y]. An example is shown in                    Embodiment 18.                -   4) In one example, the top-left neighbouring luma                    samples may be padded using the top neighbouring                    luma samples. The neighbouring top-left luma samples                    pY[x][y] with x=−1, −2, y=−1, −2, are set equal to                    the luma samples pY[x][0]. An example is shown in                    Embodiment 19.                -   5) In one example, the top-left neighbouring luma                    samples may be padded using the top and left                    neighbouring luma samples.        -   h. In one example, whether to check the availability of            top-left neighbouring luma samples, or/and use the top-left            neighbouring luma samples, or/and pad the top-left            neighbouring luma samples may depend on the chroma colour            format.            -   i. In one example, there is no need to check the                availability of top-left neighbouring luma samples,                or/and use the top-left neighbouring luma samples,                or/and pad the top-left neighbouring luma samples when                4:4:4 colour format is used. An example is shown in                Embodiment 20.        -   i. In one example, whether to pad the top-left neighbouring            luma samples and/or which samples need to be padded may            depend on a variable or a syntax element indicating whether            chroma sample positions that are not vertically shifted            relative to corresponding luma sample positions, such as            sps_chromavertical_collocated_flag in JVET-Q2001-vE.            -   i. In one example, the top-left neighbouring samples are                padded when sps_chroma_vertical_collocated_flag is equal                to 1. Otherwise, the top-left neighbouring samples are                not padded. The example is demonstrated in Embodiment                14.    -   16. During the process of CCLM, it is proposed to derive the top        (or/and left) neighbouring luma samples using the top-most        (or/and left-most) samples of current block when the top (or/and        left) neighbouring luma samples are unavailable. And the        top-left neighbouring samples may be derived using the left        (or/and top) available neighbouring luma samples.        -   a. In one example, when the top neighbouring luma samples            are unavailable, the top and top-left neighbouring luma            samples may be derived using the top-most samples of current            block and the left neighbouring luma samples.            -   i. In one example, the top neighbouring luma samples                pY[x][y] with x=0 . . . SubWidthC*nTbW−1, y=−1 . . . −2,                are set equal to the luma samples pY[x][0]. And the                top-left neighbouring luma samples pY[x][y] with x=−1,                y=−1 . . . −2, are set equal to the luma samples                pY[x][0], where pY[0][0] denotes the top-left sample of                current block, nTbW denotes the width of current block,                and SubWidthC is defined in 2.1.            -   ii. In one example, the top neighbouring samples                pY[x][y] with x=0 . . . SubWidthC*nTbW−1, y=−1 . . . −N,                are set equal to the luma samples pY[x][0]. And the                top-left neighbouring luma samples pY[x][y] with x=−M .                . . −1, y=−1 . . . −N, are set equal to the luma samples                pY[x][0], where pY[0][0] denotes the top-left sample of                current block, nTbW denotes the width of current block,                and SubWidthC is defined in 2.1. An example is                demonstrated in Embodiment 13.                -   1) In one example, M and N are integers such as M=2                    and N=3.                -   2) In one example, M may depends on the chroma color                    format, such as M=SubWidthC, which is defined in                    2.1.                -   3) In one example, at most T top-left neighbouring                    luma samples may be padded, wherein T is an integer                    such as 1.                -    a) In one example, pY[−M][−1]=pY[−M][0], wherein                    M=1 or M=SubWidthC.        -   b. In one example, when the left neighbouring luma samples            are unavailable, the left and top-left neighbouring luma            samples may be derived using the left-most samples of            current block and the top neighbouring luma samples.            -   i. In one example, the left neighbouring luma samples                pY[x][y] with x=0 . . . −3, y=−1 . . .                SubHeightC*nTbH−1, are set equal to the luma samples                pY[0][y]. And the top-left neighbouring luma samples                pY[x][y] with x=0 . . . −3, y=−1, are set equal to the                luma samples pY[0][y], where pY[0][0] denotes the                top-left sample of current block, nTbH denotes the                height of current block, and SubHeightC is defined in                2.1.            -   ii. In one example, the left neighbouring luma samples                pY[x][y] with x=−1 . . . −M, y=0 . . .                SubHeightC*nTbH−1, are set equal to the luma samples                pY[0][y]. And the top-left neighbouring luma samples                pY[x][y] with x=−1 . . . −M, y=−1 . . . −N, are set                equal to the luma samples pY[0][y], where pY[0][0]                denotes the top-left sample of current block, nTbH                denotes the height of current block, and SubHeightC is                defined in 2.1. The example is demonstrated in                Embodiment 15.                -   1) In one example, M and N are integers such as M=1,                    N=3.                -   2) In one example, N may depends on the chroma                    colour format, such as N=SubHeightC, which is                    defined in 2.1.                -   3) In one example, at most T top-left neighbouring                    luma samples may be padded, wherein T is an integer                    such as 1.                -    a) In one example, pY[−1][−N]=pY[0][−N], wherein                    N=1 or N=SubHeightC.                -    b) Alternatively, T is equal to 2.                    pY[−1][−1]=pY[0][−1], pY[−1][−2]=pY[0][−2].            -   iii. In one example, the top-left luma neighbouring                samples may be padded after the derivation of top                neighbouring luma samples. An example is demonstrated in                Embodiment 16.        -   c. In one example, the top-left neighbouring luma samples            derived in bullet 13 may be used during the process of            padding the top (or/and left) neighbouring luma samples.        -   d. In one example, whether to pad the top (or/and left)            neighbouring luma (or chroma) samples and/or which            neighbouring samples need to be padded may depend on the            chroma colour format.            -   i. In one example, there is no need to pad the top                (or/and left) neighbouring luma samples when 4:4:4                colour format is used. An example is shown in Embodiment                21.        -   e. In one example, when padding the top (or/and left)            neighbouring luma samples, the top-left neighbouring luma            samples are padded using the method in 15, such as 15.c. An            example is shown in Embodiment 22.    -   17. In the CCLM prediction process, padding of the top        neighbouring samples, left neighbouring samples and top-left        neighbouring samples may be conducted in a fixed order. The        neighbouring samples may be luma samples or chroma samples.        -   a. For example, the order maybe top neighbouring samples            padding, left neighbouring padding, and top-left            neighbouring samples padding.        -   b. For example, the order maybe left neighbouring padding,            top neighbouring samples padding, and top-left neighbouring            samples padding.        -   c. For example, the order maybe top-left neighbouring            padding, top neighbouring samples padding, and left            neighbouring samples padding.        -   d. For example, the order maybe top-left neighbouring            padding, left neighbouring samples padding, and top            neighbouring samples padding.    -   18. The process of down-sampling in CCLM for 4:2:2 colour format        video may be decoupled from a syntax element or a variable (such        as sps_chroma_vertical_collocated_flag in JVET-Q2001-vE) that        indicates whether chroma sample positions are vertically shifted        relative to corresponding luma sample positions or not.        -   a. In one example, the process of down-sampling may refer to            down-sampling the neighbouring above luma samples, or/and            down-sampling the neighbouring left luma samples, or/and            down-sampling samples in the current luma block.        -   b. In one example, regardless of            sps_chroma_vertical_collocated_flag is equal to 1 or 0, a            fixed filter (such as a 3-tap horizontal filter with            coefficients[1/4, 2/4, 1/4] or [2/8, 4/8, 2/8]) may be used            in the process of down-sampling in CCLM for 4:2:2 colour            format video. An example is shown in Embodiment 27 and            Embodiment 28.    -   19. In one example, a variable or a syntax element indicating        whether chroma sample positions are vertically shifted relative        to corresponding luma sample positions or not (e.g.,        sps_chroma_vertical_collocated_flag in JVET-Q2001-vE) may be set        to be a default value such as 0 or 1 for 4:2:2 and/or 4:4:4        colour formats.        -   a. In one example, when sps_chroma_vertical_collocated_flag            is not present, it may be inferred to be equal to 1.        -   b. In one example, when sps_chroma_vertical_collocated_flag            is not present, it may be inferred to be equal to 0.    -   20. A variable representing a neighbouring luma sample can be        used in the process of CCLM only when it is has been set equal        to a valid value. An example is shown in Embodiment 29 and        Embodiment 30.        -   a. In one example, variables representing the neighbouring            above luma samples may be set equal to the reconstructed            luma samples prior to the deblocking filter process.            -   i. In one example, when the neighbouring above luma                samples are available (e.g., availT is equal to true in                JVET-Q2001-vE), variables representing the neighbouring                above luma samples denoted as pY [x][y] are set equal to                the reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y), where                (xTbY, yTbY) represents the top-left position of the                current block.                -   1) In one example, x and y may be in the range of                    x=0 . . . SubWidthC*max(numSampT, nTbW)−1, y=−1, −2,                    wherein nTbW denotes the width of current block, and                    SubWidthC is defined in 2.1, and numSampT indicates                    the number of available neighbouring chroma samples                    on the top and top-right and is defined in                    JVET-Q2001-vE.        -   b. In one example, variables representing the neighbouring            left luma samples may be set equal to the reconstructed luma            samples prior to the deblocking filter process.            -   i. In one example, when the neighbouring left luma                samples are available (e.g., availL is equal to true in                JVET-Q2001-vE), variables representing the neighbouring                left luma samples denoted as pY[x][y] are set equal to                the reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y), where                (xTbY, yTbY) represents the top-left position of the                current block.                -   1) In one example, x and y may be in the range of                    x=−1 . . . −3, y=0 . . . SubHeightC*max(numSampL,                    nTbH)−1, where nTbH denotes the width of current                    block, and SubHeightC is defined in 2.1, and                    numSampL indicates the number of available                    neighbouring chroma samples on the left and                    left-below and is defined in JVET-Q2001-vE.    -   21. The slice type of a slice may depend on the reference        picture entries for the slice.        -   a. In one example, the slice type must be I-slice if the            number of reference picture entries for list 0 is equal to 0            and the number of reference picture entries for list 1 is            equal to 0.            -   i. In one example, the slice type is not signaled in                this case.        -   b. In one example, the slice type must be P-slice if the            number of reference picture entries for list 0 is larger            than 0 and the number of reference picture entries for list            1 is equal to 0.            -   i. Alternatively, the slice type cannot be B-slice if                the number of reference picture entries for list 0 is                larger than 0 and the number of reference picture                entries for list 1 is equal to 0.            -   ii. In one example, the slice type is not signaled in                this case.        -   c. The reference picture entries for the slice may be            signaled or inferred before the slice type is signaled or            inferred.            -   i. The reference picture entries for the slice may be                signaled in a picture header associated with the                picture.    -   22. The total number of allowed filters in APSs or the total        number of APSs may be restricted according to coded information,        such as number of subpictures.        -   a. The total number of allowed filters in APSs may include            total number of luma/chroma ALF and CC-ALF) in ALF APSs in            all APS network abstraction layer (NAL) units with a PU.        -   b. The total number of allowed filters in APSs may include            the total number of adaptive loop filter classes for luma            component (or luma ALF filters), the total number of            alternative filters for chroma components (chroma ALF            filters), and/or the total number of cross-component filters            in all APS NAL units with a PU.        -   c. The APS is an ALF APS/scaling list APS/luma mapping with            chroma scaling (LMCS) APS.        -   d. how to signal the APS identifier (ID), and/or number of            APSs to be used by a video unit is dependent on the            restricted number.    -   23. A conformance bitstream shall follow the rule that if BDPCM        is enabled for a video unit (e.g.,        sequence/picture/slice/tile/brick/subpicture), sign data hiding        is disabled.        -   a. Alternatively, a conformance bitstream shall follow the            rule that if sign data hiding is enabled for a video unit            (e.g., sequence/picture/slice/tile/brick/subpicture), BDPCM            is disabled.    -   24. A conformance bitstream shall follow the rule that if        transform skip/a coding tool which only applies identity        transform is enabled for a video unit (e.g.,        sequence/picture/slice/tile/brick/subpicture), sign data hiding        is disabled.        -   a. Alternatively, a conformance bitstream shall follow the            rule that if sign data hiding is enabled for a video unit            (e.g., sequence/picture/slice/tile/brick/subpicture),            transform skip/a coding tool which only applies identity            transform is disabled.    -   25. A conformance bitstream shall follow the rule that if BDPCM        is enabled for a video unit (e.g.,        sequence/picture/slice/tile/brick/subpicture), DQ (dependent        quantization) is disabled.        -   a. Alternatively, a conformance bitstream shall follow the            rule that if DQ is enabled for a video unit (e.g.,            sequence/picture/slice/tile/brick/subpicture), BDPCM is            disabled.    -   26. A conformance bitstream shall follow the rule that if        transform skip/a coding tool which only applies identity        transform is enabled for a video unit (e.g.,        sequence/picture/slice/tile/brick/subpicture), DQ (dependent        quantization) is disabled.        -   a. Alternatively, a conformance bitstream shall follow the            rule that if DQ is enabled for a video unit (e.g.,            sequence/picture/slice/tile/brick/subpicture), transform            skip/a coding tool which only applies identity transform is            disabled.

5. Embodiments

This section shows example embodiments and ways to modify the currentVVC standard to describe these embodiments. The changes to the VVCspecification are highlighted in bold and Italic. Deleted texts aremarked with double brackets (e.g., [[a]] denotes the deletion of thecharacter “a”).

5.1. Embodiment 1

The working draft specified in WET-P2001-v9 may be changed as below.

8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLMIntra Prediction Mode

. . .3. The down-sampled collocated luma samples pDsY[x][y] with x=0 . . .nTbW−1, y=0 . . . nTbH−1 are derived as follows:

-   -   If both SubWidthC and SubHeightC are equal to 1, the following        applies:        -   pDsY[x][y] with x=1 . . . nTbW−1, y=1 . . . nTbH−1 is            derived as follows:

pDstY[x][y]=pY[x][y]  (8-159)

-   -   Otherwise, the following applies:        -   The one-dimensional filter coefficients array F1 and F2, and            the 2-dimensional filter coefficients arrays F3 and F4 are            specified as follows.

F1[i]=1,with i=0 . . . 1  (8-160)

F2[0]=1,F2[1]=2,F2[2]=1  (8-161)

F3[i][j]=F4[i][j]=0,with i=0 . . . 2,j=0 . . . 2  (8-162)

-   -   -   -   If both SubWidthC and SubHeightC are equal to 2, the                following applies:

F1[0]=1,F1[1]=1  (8-163)

F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1  (8-164)

F4[0][1]=1,F4[1][1]=2,F4[2][1]=1  (8-165)

F4[0][2]=1,F4[1][2]=2,F4[2][2]=1  (8-166)

-   -   -   -   Otherwise, the following applies:

F1[0]=2,F1[1]=0  (8-167)

F3[1][1]=8  (8-168)

F4[0][1]=2,F4[1][1]=4,F4[2][1]=2,  (8-169)

. . .5. When numSampT is greater than 0, the selected neighbouring top chromasamples pSelC[idx] are set equal to p[pickPosT[idx−cntL]][−1] withidx=cntL . . . cntL+cntT−1, and the down-sampled neighbouring top lumasamples pSelDsY[idx] with idx=0 . . . cntL+cntT−1 are specified asfollows:. . .

-   -   Otherwise (sps_cclm_colocated_chroma_flag is equal to 0), the        following applies:        -   If x is greater than 0, the following applies:            -   If bCTUboundary is equal to FALSE, the following                applies:

pSelDsY[idx]=(F4[0][1]*pY[SubWidthC*x−1][[[−2]]−1]+F4[0][2]*pY[SubWidthC*x−1][[[−1]]−2]+F4[1][1]*pY[SubWidthC*x][[[−2]]−1]+F4[1][2]*pY[SubWidthC*x][[[−1]]−2]+F4[2][1]*pY[SubWidthC*x+1][[[−2]]−1]+F4[2][2]*pY[SubWidthC*x+1][[[−1]]−2]+4)>>3  (8-193)

-   -   -   -   Otherwise (bCTUboundary is equal to TRUE), the following                applies:

pSelDsY[idx]=(F2[0]*pY[SubWidthC*x−1][−1]+F2[1]*pY[SubWidthC*x][−1]+F2[2]*pY[SubWidthC*x+1][−1]+2)>>2  (8-194)

-   -   -   Otherwise (x is equal to 0), the following applies:            -   If availTL is equal to TRUE and bCTUboundary is equal to                FALSE, the following applies:

pSelDsY[idx]=(F4[0][1]*pY[−1][[[−2]]−1]+F4[0][2]*pY[−1][[[−1]]−2]+F4[1][1]*pY[0][[[−2]]−1]+F4[1][2]*pY[0][[[−1]]−2]+F4[2][1]*pY[1][[[−2]]−1]+F4[2][2]*pY[1][[[−1]]−2]+4)>>3  (8-195)

-   -   -   -   Otherwise, if availTL is equal to TRUE and bCTUboundary                is equal to TRUE, the following applies:

pSelDsY[idx]=(F2[0]*pY[−1][−1]+F2[1]*pY[0][−1]+F2[2]*pY[1][−1]+2)>>2  (8-196)

-   -   -   -   Otherwise, if availTL is equal to FALSE and bCTUboundary                is equal to FALSE, the following applies:

pSelDsY[idx]=(F1[1]*pY[0][−2]+F1[0]*pY[0][−1]+1)>>1  (8-197)

-   -   -   -   Otherwise (availTL is equal to FALSE and bCTUboundary is                equal to TRUE), the following applies:

pSelDsY[idx]=pY[0][−1]  (8-198)

. . .

5.2. Embodiment 2

This embodiment shows an example on chroma transform skip flag codingaccording to maximum allowed transform skip coded block sizes. Theworking draft specified in JVET-P2001-v9 may be changed as below.

7.3.9.10 Transform Unit Syntax

. . .

 if( tu_cbf_luma[ x0 ][ y0 ] && treeType != DUAL_TREE_CHROMA ) {   if(sps_transform_skip_enabled_flag && !BdpcmFlag[ x0 ][ y0 ][ 0 ] &&..   tbWidth <= MaxTsSize && tbHeight <= MaxTsSize &&    (IntraSubPartitionsSplit[ x0 ] [ y0 ] = = ISP_NO_SPLIT ) && !cu_sbt_flag)    transform_skip_flag[ x0 ][ y0 ][ 0 ] ae(v)   if(!transform_skip_flag[ x0 ][ y0 ][0] )    residual_coding( x0, y0, Log2(tbWidth ), Log2( tbHeight ), 0 )   else    residual_ts_coding( x0, y0,Log2( tbWidth ), Log2( tbHeight ), 0 )  }  if( tu_cbf_cb[ x0 ][ y0 ] &&treeType != DUAL_TREE_LUMA )   if( sps_transform_skip_enabled_flag &&!BdpcmFlag[ x0 ][ y0 ][ l ] &&    wC <= (MaxTsSize >> 

 && hC <= (MaxTsSize >>

 !cu_sbt_flag )    transform_skip_flag[ x0 ][ y0 ][ l ] ae(v)   if(!transform_skip_flag[ x0 ][ y0 ][ l ] )    residual_coding( xC, yC,Log2( wC ), Log2( hC ), 1 )   else    residual_ts_coding( xC, yC, Log2(wC ), Log2( hC ), 1 )  if( tu_cbf_cr[ x0 ][ y0 ] && treeType !=DUAL_TREE_LUMA &&   !( tu_cbf_cb[ x0 ][ y0 ] &&tu_joint_cbcr_residual_flag[ x0 ][ y0 ] )) {   if(sps_transform_skip_enabled_flag && !BdpcmFlag[ x0 ][ y0 ][ 2 ] &&    wC<= (MaxTsSize >> 

 && hC <= (MaxTsSize >>

 !cu_sbt_flag )    transform_skip_flag [ x0 ][ y0 ][ 2 ] ae(v)   if(!transform_skip_flag[ x0 ][ y0 ][ 2 ] )    residual_coding( xC, yC,Log2( wC ), Log2( hC ), 2 )   else    residual_ts_coding( xC, yC, Log2(wC ), Log2( hC), 2 )  }

5.3. Embodiment 3

This embodiment shows an example on chroma BDPCM flag coding accordingto maximum allowed chroma transform skip coded block sizes. The workingdraft specified in JVET-P2001-v9 may be changed as below.

7.3.9.5 Coding Unit Syntax

. . .

 if( ( treeType = = SINGLE_TREE | | treeType = = DUAL_TREE_CHROMA ) &&   ChromaArrayType != 0 ) {   if( pred_mode_plt_flag && treeType = =DUAL_TREE_CHROMA )    palette_coding( x0, y0, cbWidth / SubWidthC,cbHeight / SubHeightC, 1, 2 )   else {    if( !cu_act_enabled_flag ) {    if( cbWidth <= (MaxTsSize >> 

 && cbHeight <= (MaxTsSize >> 

 &&      sps_bdpcm_chroma_enabled_flag ) {      intra_bdpcm_chroma_flagae(v)      if( intra bdpcm chroma flag )      intra_bdpcm_chroma_dir_flag ae(v)     } else {      if(CclmEnabled )       cclm_mode_flag ae(v)      if( cclm_mode_flag )      cclm_mode_idx ae(v)      else       intra_chroma_pred_mode ae(v)    }    }   }

5.4. Embodiment 4

The working draft specified in JVET-Q2001-vE may be changed as below.8.4.5.2.13Inputs to this process are:

-   -   the intra prediction mode predModeIntra,    -   a sample location (xTbC, yTbC) of the top-left sample of the        current transform block relative to the top-left sample of the        current picture,    -   a variable nTbW specifying the transform block width,    -   a variable nTbH specifying the transform block height,    -   a variable cIdx specifying the colour component of the current        block,    -   chroma neighbouring samples p[x][y], with x=−1, y=0 . . .        2*nTbH−1 and x=0 . . . 2*nTbW−1, y=−1. Output of this process        are predicted samples predSamples[x][y], with x=0 . . . nTbW−1,        y=0 . . . nTbH−1.        The current luma location (xTbY, yTbY) is derived as follows:

(xTbY,yTbY)=(xTbC<<(SubWidthC−1),yTbC<<(SubHeightC−1))  (351)

The variables availL, availT and availTL are derived as follows:

-   -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY−1, yTbY), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availL.    -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY, yTbY−1), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availT.    -   The variable availTL is derived as follows:

availTL=availL&&availT  (352)

-   -   The number of available top-right neighbouring chroma samples        numTopRight is derived as follows:        -   The variable numTopRight is set equal to 0 and availTR is            set equal to TRUE.        -   When predModeIntra is equal to INTRA_T_CCLM, the following            applies for x=nTbW . . . 2*nTbW−1 until availTR is equal to            FALSE or x is equal to 2*nTbW−1:            -   The derivation process for neighbouring block                availability as specified in clause 6.4.4 is invoked                with the current luma location (xCurr, yCurr) set equal                to (xTbY, yTbY) the neighbouring luma location (xTbY+x,                yTbY−1), checkPredModeY set equal to FALSE, and cIdx as                inputs, and the output is assigned to availTR            -   When availTR is equal to TRUE, numTopRight is                incremented by one.    -   The number of available left-below neighbouring chroma samples        numLeftBelow is derived as follows:        -   The variable numLeftBelow is set equal to 0 and availLB is            set equal to TRUE.        -   When predModeIntra is equal to INTRA_L_CCLM, the following            applies for y=nTbH . . . 2*nTbH−1 until availLB is equal to            FALSE or y is equal to 2*nTbH−1:            -   The derivation process for neighbouring block                availability as specified in clause 6.4.4 is invoked                with the current luma location (xCurr, yCurr) set equal                to (xTbY, yTbY), the neighbouring luma location (xTbY−1,                yTbY+y), checkPredModeY set equal to FALSE, and cIdx as                inputs, and the output is assigned to availLB            -   When availLB is equal to TRUE, numLeftBelow is                incremented by one.                The number of available neighbouring chroma samples on                the top and top-right numSampT and the number of                available neighbouring chroma samples on the left and                left-below numSampL are derived as follows:    -   If predModeIntra is equal to INTRA_LT_CCLM, the following        applies:

numSampT=availT?nTbW:0  (353)

numSampL=availL?nTbH:0  (354)

-   -   Otherwise, the following applies:

numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0  (355)

numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0  (356)

The variable bCTUboundary is derived as follows:

bCTUboundary=(yTbY&(CtbSizeY−1)==0)?TRUE:FALSE.  (357)

The variable cntN and array pickPosN with N being replaced by L and T,are derived as follows:

-   -   The variable numIs4N is derived as follows:

numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1)  (358)

-   -   The variable startPosN is set equal to numSampN>>(2+numIs4N).    -   The variable pickStepN is set equal to Max(1,        numSampN>>(1+numIs4N)).    -   If availN is equal to TRUE and predModeIntra is equal to        INTRA_LT_CCLM or INTRA_N_CCLM, the following assignments are        made:        -   cntN is set equal to Min(numSampN, (1+numIs4N)<<1).        -   pickPosN[pos] is set equal to (startPosN+pos*pickStepN),            with pos=0 . . . cntN−1.    -   Otherwise, cntN is set equal to 0.        The prediction samples predSamples[x][y] with x=0 . . . nTbW−1,        y=0 . . . nTbH−1 are derived as follows:    -   If both numSampL and numSampT are equal to 0, the following        applies:

predSamples[x][y]=1<<(BitDepth−1)  (359)

-   -   Otherwise, the following ordered steps apply:        -   1. The collocated luma samples pY[x][y] with x=0 . . .            nTbW*SubWidthC−1, y=0 . . . nTbH*SubHeightC−1 are set equal            to the reconstructed luma samples prior to the deblocking            filter process at the locations (xTbY+x, yTbY+y).        -   2. The neighbouring luma samples pY[x][y] are derived as            follows:            -   When numSampL is greater than 0, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=0 . . .                SubHeightC*numSampL−1, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availT is equal to FALSE, the neighbouring top luma                samples pY[x][y] with x=−1 . . . SubWidthC*numSampT−1,                y=−1 . . . −2, are set equal to the luma samples                pY[x][0].            -   When availL is equal to FALSE, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=−1 . . .                SubHeightC*numSampL−1, are set equal to the luma samples                pY[0][y].            -   When numSampT is greater than 0, the neighbouring top                luma samples pY[x][y] with x=0 . . .                SubWidthC*numSampT−1, y=−1, −2, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availTL is equal to TRUE, the neighbouring top-left                luma samples pY[x][y] with x=−1, y=−1, −2, are set equal                to the reconstructed luma samples prior to the                deblocking filter process at the locations (xTbY+x,                yTbY+y).        -   3. The down-sampled collocated luma samples pDsY[x][y] with            x=0 . . . nTbW−1, y=0 . . . nTbH−1 are derived as follows:            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:                -   pDsY[x][y] with x=1 . . . nTbW−1, y=1 . . . nTbH−1                    is derived as follows:

pDstY[x][y]=pY[x][y]  (360)

-   -   -   -   Otherwise, the following applies:                -   The one-dimensional filter coefficients array F1 and                    F2, and the 2-dimensional filter coefficients arrays                    F3 and F4 are specified as follows.

F1[0]=2,F1[1]=0  (361)

F2[0]=1,F2[1]=2,F2[2]=1  (362)

F3[i][j]=F4[i][j]=0,with i=0 . . . 2,j=0 . . . 2  (363)

-   -   -   -   -    If both SubWidthC and SubHeightC are equal to 2,                    the following applies:

F1[0]=1,F1[1]=1  (364)

F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1  (365)

F4[0][1]=1,F4[1][1]=2,F4[2][1]=1  (366)

F4[0][2]=1,F4[1][2]=2,F4[2][2]=1  (367)

-   -   -   -   -    Otherwise, the following applies:

F3[1][1]=8  (368)

F4[0][1]=2,F4[1][1]=4,F4[2][1]=2,  (369)

-   -   -   -   -   If sps_chroma_vertical_collocated_flag is equal to                    1, the following applies:                -    pDsY[x][y] with x=0 . . . nTbW−1, y=0 . . . nTbH−1                    is derived as follows:

pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y−1]+F3[0][1]*pY[SubWidthC*x−1][SubHeightC*y]+F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3  (370)

-   -   -   -   -   Otherwise (sps_chroma_vertical_collocated_flag is                    equal to 0), the following applies:                -    pDsY[x][y] with x=0 . . . nTbW−1, y=0 . . . nTbH−1                    is derived as follows:

pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x−1][SubHeightC*y]+F4[0][2]*pY[SubWidthC*x−1][SubHeightC*y+1]+F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3  (371)

-   4.    ,    ,    -   .    -   ,        -       -   ,        -   ,            -   ,                -   

                -    

                -    

                -    

                -                -   ,                -   

                -    

                -            -   ,            -   ,                -   

                -    

                -    

                -    

                -    

                -                -   ,                -   

                -    

                -    -   ,    ,    ,    -   .

    -   ,        -   

    -   -   ,            -   -   

                -   

                -   

                -           -   ,            -   -   

                -   

                -   

                -   

                -   -   6. When cntT+cntL is not equal to 0, the variables minY, maxY, minC    and maxC are derived as follows:    -   When cntT+cntL is equal to 2, pSelComp[3] is set equal to        pSelComp[0], pSelComp[2] is set equal to pSelComp[1],        pSelComp[0] is set equal to pSelComp[1], and pSelComp[1] is set        equal to pSelComp[3], with Comp being replaced by DsY and C.    -   The arrays minGrpIdx and maxGrpIdx are derived as follows:

minGrpIdx[0]=0  (380)

minGrpIdx[1]=2  (381)

maxGrpIdx[0]=1  (382)

maxGrpIdx[1]=3  (383)

-   -   When pSelDsY[minGrpIdx[0]] is greater than        pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are swapped        as follows:

(minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1])  (384)

-   -   When pSelDsY[maxGrpIdx[0]] is greater than        pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are swapped        as follows:

(maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1])  (385)

-   -   When pSelDsY[minGrpIdx[0]] is greater than        pSelDsY[maxGrpIdx[1]], arrays minGrpIdx and maxGrpIdx are        swapped as follows:

(minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx)  (386)

-   -   When pSelDsY[minGrpIdx[1]] is greater than        pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are swapped        as follows:

(minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0])  (387)

-   -   The variables maxY, maxC, minY and minC are derived as follows:

maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1  (388)

maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1  (389)

minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1  (390)

minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1  (391)

-   7. The variables a, b, and k are derived as follows:    -   If numSampL is equal to 0, and numSampT is equal to 0, the        following applies:

k=0  (392)

a=0  (393)

b=1<<(BitDepth−1)  (394)

-   -   Otherwise, the following applies:

diff=maxY−minY  (395)

-   -   -   If diff is not equal to 0, the following applies:

diffC=maxC−minC  (396)

x=Floor(Log 2(diff))  (397)

normDiff=((diff<<4)>>x)&15  (398)

x+=(normDiff!=0)?1:0  (399)

y=Abs(diffC)>0?Floor(Log 2(Abs(diffC)))+1:0  (400)

a=(diffC*(divSigTable[normDiff]|8)+2^(y-1))>>y  (401)

k=((3+x−y)<1)?1:3+x−y  (402)

a=((3+x−y)<1)?Sign(a)*15:a  (403)

b=minC−((a*minY)>>k)  (404)

-   -   -   -   where divSigTable[ ] is specified as follows:

divSigTable[ ]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0}  (405)

-   -   Otherwise (diff is equal to 0), the following applies:

k=0  (406)

a=0  (407)

b=minC  (408)

-   8. The prediction samples predSamples[x][y] with x=0 . . . nTbW−1,    y=0 . . . nTbH−1 are derived as follows:

predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b)  (409)

-   -   NOTE—This process uses sps_chroma_vertical_collocated_flag.        However, in order to simplify implementation, it does not use        sps_chroma_horizontal_collocated_flag.

5.5. Embodiment 5

The working draft specified in JVET-Q2001-vE may be changed as below.8.4.5.2.13Inputs to this process are:

-   -   the intra prediction mode predModeIntra,    -   a sample location (xTbC, yTbC) of the top-left sample of the        current transform block relative to the top-left sample of the        current picture,    -   a variable nTbW specifying the transform block width,    -   a variable nTbH specifying the transform block height,    -   a variable cIdx specifying the colour component of the current        block,    -   chroma neighbouring samples p[x][y], with x=−1, y=0 . . .        2*nTbH−1 and x=0 . . . 2*nTbW−1, y=−1.        Output of this process are predicted samples predSamples[x][y],        with x=0 . . . nTbW−1, y=0 . . . nTbH−1.        The current luma location (xTbY, yTbY) is derived as follows:

(xTbY,yTbY)=(xTbC<<(SubWidthC−1),yTbC<<(SubHeightC−1))  (351)

The variables availL, availT and availTL are derived as follows:

-   -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY−1, yTbY), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availL.    -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY, yTbY−1), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availT.    -   The variable availTL is derived as follows:

availTL=availL&&availT  (352)

-   -   The number of available top-right neighbouring chroma samples        numTopRight is derived as follows:        -   The variable numTopRight is set equal to 0 and availTR is            set equal to TRUE.        -   When predModeIntra is equal to INTRA_T_CCLM, the following            applies for x=nTbW . . . 2*nTbW−1 until availTR is equal to            FALSE or x is equal to 2*nTbW−1:            -   The derivation process for neighbouring block                availability as specified in clause 6.4.4 is invoked                with the current luma location (xCurr, yCurr) set equal                to (xTbY, yTbY) the neighbouring luma location (xTbY+x,                yTbY−1), checkPredModeY set equal to FALSE, and cIdx as                inputs, and the output is assigned to availTR            -   When availTR is equal to TRUE, numTopRight is                incremented by one.    -   The number of available left-below neighbouring chroma samples        numLeftBelow is derived as follows:        -   The variable numLeftBelow is set equal to 0 and availLB is            set equal to TRUE.        -   When predModeIntra is equal to INTRA_L_CCLM, the following            applies for y=nTbH . . . 2*nTbH−1 until availLB is equal to            FALSE or y is equal to 2*nTbH−1:            -   The derivation process for neighbouring block                availability as specified in clause 6.4.4 is invoked                with the current luma location (xCurr, yCurr) set equal                to (xTbY, yTbY), the neighbouring luma location (xTbY−1,                yTbY+y), checkPredModeY set equal to FALSE, and cIdx as                inputs, and the output is assigned to availLB            -   When availLB is equal to TRUE, numLeftBelow is                incremented by one.                The number of available neighbouring chroma samples on                the top and top-right numSampT and the number of                available neighbouring chroma samples on the left and                left-below numSampL are derived as follows:    -   If predModeIntra is equal to INTRA_LT_CCLM, the following        applies:

numSampT=availT?nTbW:0  (353)

numSampL=availL?nTbH:0  (354)

-   -   Otherwise, the following applies:

numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0  (355)

numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0  (356)

The variable bCTUboundary is derived as follows:

bCTUboundary=(yTbY&(CtbSizeY−1)==0)?TRUE:FALSE.  (357)

The variable cntN and array pickPosN with N being replaced by L and T,are derived as follows:

-   -   The variable numIs4N is derived as follows:

numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1)  (358)

-   -   The variable startPosN is set equal to numSampN>>(2+numIs4N).    -   The variable pickStepN is set equal to Max(1,        numSampN>>(1+numIs4N)).    -   If availN is equal to TRUE and predModeIntra is equal to        INTRA_LT_CCLM or INTRA_N_CCLM, the following assignments are        made:        -   cntN is set equal to Min(numSampN, (1+numIs4N)<<1).        -   pickPosN[pos] is set equal to (startPosN+pos*pickStepN),            with pos=0 . . . cntN−1.    -   Otherwise, cntN is set equal to 0.        The prediction samples predSamples[x][y] with x=0 . . . nTbW−1,        y=0 . . . nTbH−1 are derived as follows:    -   If both numSampL and numSampT are equal to 0, the following        applies:

predSamples[x][y]=1<<(BitDepth−1)  (359)

-   -   Otherwise, the following ordered steps apply:        -   1. The collocated luma samples pY[x][y] with x=0 . . .            nTbW*SubWidthC−1, y=0 . . . nTbH*SubHeightC−1 are set equal            to the reconstructed luma samples prior to the deblocking            filter process at the locations (xTbY+x, yTbY+y).        -   2. The neighbouring luma samples pY[x][y] are derived as            follows:            -   When numSampL is greater than 0, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=0 . . .                SubHeightC*numSampL−1, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availT is equal to FALSE, the neighbouring top luma                samples pY[x][y] with x=−1 . . . SubWidthC*numSampT−1,                y=−1 . . . −2, are set equal to the luma samples                pY[x][0].            -   When availL is equal to FALSE, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=−1 . . .                SubHeightC*numSampL−1, are set equal to the luma samples                pY[0][y].            -   When numSampT is greater than 0, the neighbouring top                luma samples pY[x][y] with x=0 . . .                SubWidthC*numSampT−1, y=−1, −2, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availTL is equal to TRUE, the neighbouring top-left                luma samples pY[x][y] with x=−1, y=−1, −2, are set equal                to the reconstructed luma samples prior to the                deblocking filter process at the locations (xTbY+x,                yTbY+y).        -   3. The down-sampled collocated luma samples pDsY[x][y] with            x=0 . . . nTbW−1, y=0 . . . nTbH−1 are derived as follows:            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:                -   pDsY[x][y] with x=1 . . . nTbW−1, y=1 . . . nTbH−1                    is derived as follows:

pDstY[x][y]=pY[x][y]  (360)

-   -   -   -   Otherwise, the following applies:                -   The one-dimensional filter coefficients array F1 and                    F2, and the 2-dimensional filter coefficients arrays                    F3 and F4 are specified as follows.

F1[0]=2,F1[1]=0  (361)

F2[0]=1,F2[1]=2,F2[2]=1  (362)

F3[i][j]=F4[i][j]=0,with i=0 . . . 2,j=0 . . . 2  (363)

-   -   -   -   -    If both SubWidthC and SubHeightC are equal to 2,                    the following applies:

F1[0]=1,F1[1]=1  (364)

F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1  (365)

F4[0][1]=1,F4[1][1]=2,F4[2][1]=1  (366)

F4[0][2]=1,F4[1][2]=2,F4[2][2]=1  (367)

-   -   -   -   -    Otherwise, the following applies:

F3[1][1]=8  (368)

F4[0][1]=2,F4[1][1]=4,F4[2][1]=2,  (369)

-   -   -   -   -   If sps_chromavertical_collocated_flag is equal to 1,                    the following applies:                -    pDsY[x][y] with x=0 . . . nTbW−1, y=0 . . . nTbH−1                    is derived as follows:

pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y−1]+F3[0][1]*pY[SubWidthC*x−1][SubHeightC*y]+F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3  (370)

-   -   -   -   -   Otherwise (sps_chromavertical_collocated_flag is                    equal to 0), the following applies:                -    pDsY[x][y] with x=0 . . . nTbW−1, y=0 . . . nTbH−1                    is derived as follows:

pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x−1][SubHeightC*y]+F4[0][2]*pY[SubWidthC*x−1][SubHeightC*y+1]+F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3  (371)

-   -   -   4. When numSampL is greater than 0, the selected            neighbouring left chroma samples pSelC[idx] are set equal to            p[−1][pickPosL[idx]] with idx=0 . . . cntL−1, and the            selected down-sampled neighbouring left luma samples            pSelDsY[idx] with idx=0 . . . cntL−1 are derived as follows:            -   The variable y is set equal to pickPosL[idx].            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:

pSelDsY[idx]=pY[−1][y]  (372)

-   -   -   -   Otherwise the following applies:                -   If sps_chroma_vertical_collocated_flag is equal to                    1, the following applies:

pSelDsY[idx]=(F3[1][0]*pY[−SubWidthC][SubHeightC*y−1]+F3[0][1]*pY[−1−SubWidthC][SubHeightC*y]+F3[1][1]*pY[−SubWidthC][SubHeightC*y]+F3[2][1]*pY[1−SubWidthC][SubHeightC*y]+F3[1][2]*pY[−SubWidthC][SubHeightC*y+1]+4)>>3  (373)

-   -   -   -   -   Otherwise (sps_chroma_vertical_collocated_flag is                    equal to 0), the following applies:

pSelDsY[idx]=(F4[0][1]*pY[−1−SubWidthC][SubHeightC*y]+F4[0][2]*pY[−1−SubWidthC][SubHeightC*y]+1+F4[1][1]*pY[−SubWidthC][SubHeightC*y]+F4[1][2]*pY[−SubWidthC][SubHeightC*y+1]+F4[2][1]*pY[1−SubWidthC][SubHeightC*y]+F4[2][2]*pY[1−SubWidthC][SubHeightC*y+1]+4)>>3  (374)

-   -   -   5. When numSampT is greater than 0, the selected            neighbouring top chroma samples pSelC[idx] are set equal to            p[pickPosT[idx−cntL]][−1] with idx=cntL . . . cntL+cntT−1,            and the down-sampled neighbouring top luma samples            pSelDsY[idx] with idx=[[0]]            . . . cntL+cntT−1 are specified as follows:            -   The variable x is set equal to pickPosT[idx−cntL].            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:

pSelDsY[idx]=pY[x][−1]  (375)

-   -   -   -   Otherwise, the following applies:                -   If sps_chroma_vertical_collocated_flag is equal to                    1, the following applies:                -    If bCTUboundary is equal to FALSE, the following                    applies:

pSelDsY[idx]=(F3[1][0]*pY[SubWidthC*x][−1−SubHeightC]+F3[0][1]*pY[SubWidthC*x−1][−SubHeightC]+F3[1][1]*pY[SubWidthC*x][−SubHeightC]+F3[2][1]*pY[SubWidthC*x+1][−SubHeightC]+F3[1][2]*pY[SubWidthC*x][1−SubHeightC]+4)>>3  (376)

-   -   -   -   -    Otherwise (bCTUboundary is equal to TRUE), the                    following applies:

pSelDsY[idx]=(F2[0]*pY[SubWidthC*x−1][−1]+F2[1]*pY[SubWidthC*x][−1]+F2[2]*pY[SubWidthC*x+1][−1]+2)>>2  (377)

-   -   -   -   -   Otherwise (sps_chroma_vertical_collocated_flag is                    equal to 0), the following applies:                -    If bCTUboundary is equal to FALSE, the following                    applies:

pSelDsY[idx]=(F4[0][1]*pY[SubWidthCx−1][−1]+F4[0][2]*pY[SubWidthC*x−1][−2]+F4[1][1]*pY[SubWidthC*x][−1]+F4[1][2]*pY[SubWidthC*x][−2]+F4[2][1]*pY[SubWidthC*x+1][−1]+F4[2][2]*pY[SubWidthC*x+1][−2]+4)>>3  (378)

-   -   -   -   -    Otherwise (bCTUboundary is equal to TRUE), the                    following applies:

pSelDsY[idx]=(F2[0]*pY[SubWidthC*x−1][−1]+F2[1]*pY[SubWidthC*x][−1]+F2[2]*pY[SubWidthC*x+1][−1]+2)>>2  (379)

-   -   -   6. When cntT+cntL is not equal to 0, the variables minY,            maxY, minC and maxC are derived as follows:            -   When cntT+cntL is equal to 2, pSelComp[3] is set equal                to pSelComp[0], pSelComp[2] is set equal to pSelComp[1],                pSelComp[0] is set equal to pSelComp[1], and pSelComp[1]                is set equal to pSelComp[3], with Comp being replaced by                DsY and C.            -   The arrays minGrpIdx and maxGrpIdx are derived as                follows:

minGrpIdx[0]=0  (380)

minGrpIdx[1]=2  (381)

maxGrpIdx[0]=1  (382)

maxGrpIdx[1]=3  (383)

-   -   -   -   When pSelDsY[minGrpIdx[0]] is greater than                pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are                swapped as follows:

(minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1])  (384)

-   -   -   -   When pSelDsY[maxGrpIdx[0]] is greater than                pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are                swapped as follows:

(maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1])  (385)

-   -   -   -   When pSelDsY[minGrpIdx[0]] is greater than                pSelDsY[maxGrpIdx[1]], arrays minGrpIdx and maxGrpIdx                are swapped as follows:

(minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx)  (386)

-   -   -   -   When pSelDsY[minGrpIdx[1]] is greater than                pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are                swapped as follows:

(minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0])  (387)

-   -   -   -   The variables maxY, maxC, minY and minC are derived as                follows:

maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1  (388)

maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1  (389)

minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1  (390)

minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1  (391)

-   -   -   7. The variables a, b, and k are derived as follows:            -   If numSampL is equal to 0, and numSampT is equal to 0,                the following applies:

k=0  (392)

a=0  (393)

b=1<<(BitDepth−1)  (394)

-   -   -   -   Otherwise, the following applies:

diff=maxY−minY  (395)

-   -   -   -   -   If diff is not equal to 0, the following applies:

diffC=maxC−minC  (396)

x=Floor(Log 2(diff))  (397)

normDiff=((diff<<4)>>x)&15  (398)

x+=(normDiff!=0)?1:0  (399)

y=Abs(diffC)>0?Floor(Log 2(Abs(diffC)))+1:0  (400)

a=(diffC*(divSigTable[normDiff]|8)+2^(y-1))>>y  (401)

k=((3+x−y)<1)?1:3+x−y  (402)

a=((3+x−y)<1)?Sign(a)*15:a  (403)

b=minC−((a*minY)>>k)  (404)

-   -   -   -   -    where divSigTable[ ] is specified as follows:

divSigTable[ ]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0}  (405)

-   -   -   -   -   Otherwise (diff is equal to 0), the following                    applies:

k=0  (406)

a=0  (407)

b=minC  (408)

-   -   -   8. The prediction samples predSamples[x][y] with x=0 . . .            nTbW−1, y=0 . . . nTbH−1 are derived as follows:

predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b)  (409)

-   -   NOTE—This process uses sps_chroma_vertical_collocated_flag.        However, in order to simplify implementation, it does not use        sps_chroma_horizontal_collocated_flag.

5.6. Embodiment 6

The working draft specified in JVET-Q2001-vE may be changed as below.8.4.5.2.13Inputs to this process are:

-   -   the intra prediction mode predModeIntra,    -   a sample location (xTbC, yTbC) of the top-left sample of the        current transform block relative to the top-left sample of the        current picture,    -   a variable nTbW specifying the transform block width,    -   a variable nTbH specifying the transform block height,    -   a variable cIdx specifying the colour component of the current        block,    -   chroma neighbouring samples p[x][y], with x=−1, y=0 . . .        2*nTbH−1 and x=0 . . . 2*nTbW−1, y=−1.        Output of this process are predicted samples predSamples[x][y],        with x=0 . . . nTbW−1, y=0 . . . nTbH−1.        The current luma location (xTbY, yTbY) is derived as follows:

(xTbY,yTbY)=(xTbC<<(SubWidthC−1),yTbC<<(SubHeightC−1))  (351)

The variables availL, availT and availTL are derived as follows:

-   -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY−1, yTbY), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availL.    -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY, yTbY−1), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availT.    -   The variable availTL is derived as follows:

availTL=availL&&availT  (352)

-   -   The number of available top-right neighbouring chroma samples        numTopRight is derived as follows:        -   The variable numTopRight is set equal to 0 and availTR is            set equal to TRUE.        -   When predModeIntra is equal to INTRA_T_CCLM, the following            applies for x=nTbW . . . 2*nTbW−1 until availTR is equal to            FALSE or x is equal to 2*nTbW−1:            -   The derivation process for neighbouring block                availability as specified in clause 6.4.4 is invoked                with the current luma location (xCurr, yCurr) set equal                to (xTbY, yTbY) the neighbouring luma location (xTbY+x,                yTbY−1), checkPredModeY set equal to FALSE, and cIdx as                inputs, and the output is assigned to availTR            -   When availTR is equal to TRUE, numTopRight is                incremented by one.    -   The number of available left-below neighbouring chroma samples        numLeftBelow is derived as follows:        -   The variable numLeftBelow is set equal to 0 and availLB is            set equal to TRUE.        -   When predModeIntra is equal to INTRA_L_CCLM, the following            applies for y=nTbH . . . 2*nTbH−1 until availLB is equal to            FALSE or y is equal to 2*nTbH−1:            -   The derivation process for neighbouring block                availability as specified in clause 6.4.4 is invoked                with the current luma location (xCurr, yCurr) set equal                to (xTbY, yTbY), the neighbouring luma location (xTbY−1,                yTbY+y), checkPredModeY set equal to FALSE, and cIdx as                inputs, and the output is assigned to availLB            -   When availLB is equal to TRUE, numLeftBelow is                incremented by one.                The number of available neighbouring chroma samples on                the top and top-right numSampT and the number of                available neighbouring chroma samples on the left and                left-below numSampL are derived as follows:    -   If predModeIntra is equal to INTRA_LT_CCLM, the following        applies:

numSampT=availT?nTbW:0  (353)

numSampL=availL?nTbH:0  (354)

-   -   Otherwise, the following applies:

numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0  (355)

numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0  (356)

The variable bCTUboundary is derived as follows:

bCTUboundary=(yTbY&(CtbSizeY−1)==0)?TRUE:FALSE.  (357)

The variable cntN and array pickPosN with N being replaced by L and T,are derived as follows:

-   -   The variable numIs4N is derived as follows:

numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1)  (358)

-   -   The variable startPosN is set equal to numSampN>>(2+numIs4N).    -   The variable pickStepN is set equal to Max(1,        numSampN>>(1+numIs4N)).    -   If availN is equal to TRUE and predModeIntra is equal to        INTRA_LT_CCLM or INTRA_N_CCLM, the following assignments are        made:        -   cntN is set equal to Min(numSampN, (1+numIs4N)<<1).        -   pickPosN[pos] is set equal to (startPosN+pos*pickStepN),            with pos=0 . . . cntN−1.    -   Otherwise, cntN is set equal to 0.        The prediction samples predSamples[x][y] with x=0 . . . nTbW−1,        y=0 . . . nTbH−1 are derived as follows:    -   If both numSampL and numSampT are equal to 0, the following        applies:

predSamples[x][y]=1<<(BitDepth−1)  (359)

-   -   Otherwise, the following ordered steps apply:        -   1. The collocated luma samples pY[x][y] with x=0 . . .            nTbW*SubWidthC−1, y=0 . . . nTbH*SubHeightC−1 are set equal            to the reconstructed luma samples prior to the deblocking            filter process at the locations (xTbY+x, yTbY+y).        -   2. The neighbouring luma samples pY[x][y] are derived as            follows:            -   When numSampL is greater than 0, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=0 . . .                SubHeightC*numSampL−1, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availT is equal to FALSE, the neighbouring top luma                samples pY[x][y] with x=−1 . . . SubWidthC*numSampT−1,                y=−1 . . . −2, are set equal to the luma samples                pY[x][0].            -   When availL is equal to FALSE, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=−1 . . .                SubHeightC*numSampL−1, are set equal to the luma samples                pY[0][y].            -   When numSampT is greater than 0, the neighbouring top                luma samples pY[x][y] with x=0 . . .                SubWidthC*numSampT−1, y=−1, 1[2]13, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availTL is equal to TRUE, the neighbouring top-left                luma samples pY[x][y] with x=−1, y=−1, −2, −3 are set                equal to the reconstructed luma samples prior to the                deblocking filter process at the locations (xTbY+x,                yTbY+y).        -   3. The down-sampled collocated luma samples pDsY[x][y] with            x=0 . . . nTbW−1, y=0 . . . nTbH−1 are derived as follows:            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:                -   pDsY[x][y] with x=1 . . . nTbW−1, y=1 . . . nTbH−1                    is derived as follows:

pDstY[x][y]=pY[x][y]  (360)

-   -   -   -   Otherwise, the following applies:                -   The one-dimensional filter coefficients array F1 and                    F2, and the 2-dimensional filter coefficients arrays                    F3 and F4 are specified as follows.

F1[0]=2,F1[1]=0  (361)

F2[0]=1,F2[1]=2,F2[2]=1  (362)

F3[i][j]=F4[i][j]=0,with i=0 . . . 2,j=0 . . . 2  (363)

-   -   -   -   -    If both SubWidthC and SubHeightC are equal to 2,                    the following applies:

F1[0]=1,F1[1]=1  (364)

F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1  (365)

F4[0][1]=1,F4[1][1]=2,F4[2][1]=1  (366)

F4[0][2]=1,F4[1][2]=2,F4[2][2]=1  (367)

-   -   -   -   -    Otherwise, the following applies:

F3[1][1]=8  (368)

F4[0][1]=2,F4[1][1]=4,F4[2][1]=2,  (369)

-   -   -   -   -   If sps_chromavertical_collocated_flag is equal to 1,                    the following applies:                -    pDsY[x][y] with x=0 . . . nTbW−1, y=0 . . . nTbH−1                    is derived as follows:

pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y−1]+F3[0][1]*pY[SubWidthC*x−1][SubHeightC*y]+F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3  (370)

-   -   -   -   -   Otherwise (sps_chroma_vertical_collocated_flag is                    equal to 0), the following applies:                -    pDsY[x][y] with x=0 . . . nTbW−1, y=0 . . . nTbH−1                    is derived as follows:

pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x−1][SubHeightC*y]+F4[0][2]*pY[SubWidthC*x−1][SubHeightC*y+1]+F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3  (371)

-   -   -   4. When numSampL is greater than 0, the selected            neighbouring left chroma samples pSelC[idx] are set equal to            p[−1][pickPosL[idx]] with idx=0 . . . cntL−1, and the            selected down-sampled neighbouring left luma samples            pSelDsY[idx] with idx=0 . . . cntL−1 are derived as follows:            -   The variable y is set equal to pickPosL[idx].            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:

pSelDsY[idx]=pY[−1][y]  (372)

-   -   -   -   Otherwise the following applies:                -   If sps_chroma_vertical_collocated_flag is equal to                    1, the following applies:

pSelDsY[idx]=(F3[1][0]*pY[−SubWidthC][SubHeightC*y−1]+F3[0][1]*pY[−1−SubWidthC][SubHeightC*y]+F3[1][1]*pY[−SubWidthC][SubHeightC*y]+F3[2][1]*pY[1−SubWidthC][SubHeightC*y]+F3[1][2]*pY[−SubWidthC][SubHeightC*y+1]+4)>>3  (373)

-   -   -   -   -   Otherwise (sps_chroma_vertical_collocated_flag is                    equal to 0), the following applies:

pSelDsY[idx]=(F4[0][1]*pY[−1−SubWidthC][SubHeightC*y]+F4[0][2]*pY[−1−SubWidthC][SubHeightC*y+1]+F4[1][1]*pY[−SubWidthC][SubHeightC*y]+F4[1][2]*pY[−SubWidthC][SubHeightC*y+1]+F4[2][1]*pY[1−SubWidthC][SubHeightC*y]+F4[2][2]*pY[1−SubWidthC][SubHeightC*y+1]+4)>>3  (374)

-   -   -   5. When numSampT is greater than 0, the selected            neighbouring top chroma samples pSelC[idx] are set equal to            p[pickPosT[idx−cntL]][−1] with idx=cntL . . . cntL+cntT−1,            and the down-sampled neighbouring top luma samples            pSelDsY[idx] with idx=0 . . . cntL+cntT−1 are specified as            follows:            -   The variable x is set equal to pickPosT[idx−cntL].            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:

pSelDsY[idx]=pY[x][−1]  (375)

-   -   -   -   Otherwise, the following applies:                -   If sps_chroma_vertical_collocated_flag is equal to                    1, the following applies:                -    If bCTUboundary is equal to FALSE, the following                    applies:

pSelDsY[idx]=(F3[1][0]*pY[SubWidthC*x][−1−SubHeightC]+F3[0][1]*pY[SubWidthC*x−1][−SubHeightC]+F3[1][1]*pY[SubWidthC*x][−SubHeightC]+F3[2][1]*pY[SubWidthC*x+1][−SubHeightC]+F3[1][2]*pY[SubWidthC*x][1−SubHeightC]+4)>>3  (376)

-   -   -   -   -    Otherwise (bCTUboundary is equal to TRUE), the                    following applies:

pSelDsY[idx]=(F2[0]*pY[SubWidthC*x−1][−1]+F2[1]*pY[SubWidthC*x][−1]+F2[2]*pY[SubWidthC*x+1][−1]+2)>>2  (377)

-   -   -   -   -   Otherwise (sps_chroma_vertical_collocated_flag is                    equal to 0), the following applies:                -    If bCTUboundary is equal to FALSE, the following                    applies:

pSelDsY[idx]=(F4[0][1]*pY[SubWidthCx−1][−1]+F4[0][2]*pY[SubWidthC*x−1][−2]+F4[1][1]*pY[SubWidthC*x][−1]+F4[1][2]*pY[SubWidthC*x][−2]+F4[2][1]*pY[SubWidthC*x+1][−1]+F4[2][2]*pY[SubWidthC*x+1][−2]+4)>>3  (378)

-   -   -   -   -    Otherwise (bCTUboundary is equal to TRUE), the                    following applies:

pSelDsY[idx]=(F2[0]*pY[SubWidthC*x−1][−1]+F2[1]*pY[SubWidthC*x][−1]+F2[2]*pY[SubWidthC*x+1][−1]+2)>>2  (379)

-   -   -   6. When cntT+cntL is not equal to 0, the variables minY,            maxY, minC and maxC are derived as follows:            -   When cntT+cntL is equal to 2, pSelComp[3] is set equal                to pSelComp[0], pSelComp[2] is set equal to pSelComp[1],                pSelComp[0] is set equal to pSelComp[1], and pSelComp[1]                is set equal to pSelComp[3], with Comp being replaced by                DsY and C.            -   The arrays minGrpIdx and maxGrpIdx are derived as                follows:

minGrpIdx[0]=0  (380)

minGrpIdx[1]=2  (381)

maxGrpIdx[0]=1  (382)

maxGrpIdx[1]=3  (383)

-   -   -   -   When pSelDsY[minGrpIdx[0]] is greater than                pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are                swapped as follows:

(minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1])  (384)

-   -   -   -   When pSelDsY[maxGrpIdx[0]] is greater than                pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are                swapped as follows:

(maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1])  (385)

-   -   -   -   When pSelDsY[minGrpIdx[0]] is greater than                pSelDsY[maxGrpIdx[1]], arrays minGrpIdx and maxGrpIdx                are swapped as follows:

(minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx)  (386)

-   -   -   -   When pSelDsY[minGrpIdx[1]] is greater than                pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are                swapped as follows:

(minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0])  (387)

-   -   -   -   The variables maxY, maxC, minY and minC are derived as                follows:

maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1  (388)

maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1  (389)

minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1  (390)

minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1  (391)

-   -   -   7. The variables a, b, and k are derived as follows:            -   If numSampL is equal to 0, and numSampT is equal to 0,                the following applies:

k=0  (392)

a=0  (393)

b=1<<(BitDepth−1)  (394)

-   -   -   -   Otherwise, the following applies:

diff=maxY−minY  (395)

-   -   -   -   -   If diff is not equal to 0, the following applies:

diffC=maxC−minC  (396)

x=Floor(Log 2(diff))  (397)

normDiff=((diff<<4)>>x)&15  (398)

x+=(normDiff!=0)?1:0  (399)

y=Abs(diffC)>0?Floor(Log 2(Abs(diffC)))+1:0  (400)

a=(diffC*(divSigTable[normDiff]|8)+2^(y-1))>>y  (401)

k=((3+x−y)<1)?1:3+x−y  (402)

a=((3+x−y)<1)?Sign(a)*15:a  (403)

b=minC−((a*minY)>>k)  (404)

-   -   -   -   -    where divSigTable[ ] is specified as follows:

divSigTable[ ]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0}  (405)

-   -   -   -   -   Otherwise (diff is equal to 0), the following                    applies:

k=0  (406)

a=0  (407)

b=minC  (408)

-   -   -   8. The prediction samples predSamples[x][y] with x=0 . . .            nTbW−1, y=0 . . . nTbH−1 are derived as follows:

predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b)  (409)

-   -   NOTE—This process uses sps_chroma_vertical_collocated_flag.        However, in order to simplify implementation, it does not use        sps_chroma_horizontal_collocated_flag.

5.7. Embodiment 7

The working draft specified in JVET-Q2001-vE may be changed as below.8.4.5.2.13Inputs to this process are:

-   -   the intra prediction mode predModeIntra,    -   a sample location (xTbC, yTbC) of the top-left sample of the        current transform block relative to the top-left sample of the        current picture,    -   a variable nTbW specifying the transform block width,    -   a variable nTbH specifying the transform block height,    -   a variable cIdx specifying the colour component of the current        block,    -   chroma neighbouring samples p[x][y], with x=−1, y=0 . . .        2*nTbH−1 and x=0 . . . 2*nTbW−1, y=−1.        Output of this process are predicted samples predSamples[x][y],        with x=0 . . . nTbW−1, y=0 . . . nTbH−1.        The current luma location (xTbY, yTbY) is derived as follows:

(xTbY,yTbY)=(xTbC<<(SubWidthC−1),yTbC<<(SubHeightC−1))  (351)

The variables availL, availT and availTL are derived as follows:

-   -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY−1, yTbY), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availL.    -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY, yTbY−1), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availT.    -   The variable availTL is derived as follows:

availTL=availL&&availT  (352)

-   -   The number of available top-right neighbouring chroma samples        numTopRight is derived as follows:        -   The variable numTopRight is set equal to 0 and availTR is            set equal to TRUE.        -   When predModeIntra is equal to INTRA_T_CCLM, the following            applies for x=nTbW . . . 2*nTbW−1 until availTR is equal to            FALSE or x is equal to 2*nTbW−1:            -   The derivation process for neighbouring block                availability as specified in clause 6.4.4 is invoked                with the current luma location (xCurr, yCurr) set equal                to (xTbY, yTbY) the neighbouring luma location (xTbY+x,                yTbY−1), checkPredModeY set equal to FALSE, and cIdx as                inputs, and the output is assigned to availTR            -   When availTR is equal to TRUE, numTopRight is                incremented by one.    -   The number of available left-below neighbouring chroma samples        numLeftBelow is derived as follows:        -   The variable numLeftBelow is set equal to 0 and availLB is            set equal to TRUE.        -   When predModeIntra is equal to INTRA_L_CCLM, the following            applies for y=nTbH . . . 2*nTbH−1 until availLB is equal to            FALSE or y is equal to 2*nTbH−1:            -   The derivation process for neighbouring block                availability as specified in clause 6.4.4 is invoked                with the current luma location (xCurr, yCurr) set equal                to (xTbY, yTbY), the neighbouring luma location (xTbY−1,                yTbY+y), checkPredModeY set equal to FALSE, and cIdx as                inputs, and the output is assigned to availLB            -   When availLB is equal to TRUE, numLeftBelow is                incremented by one.                The number of available neighbouring chroma samples on                the top and top-right numSampT and the number of                available neighbouring chroma samples on the left and                left-below numSampL are derived as follows:    -   If predModeIntra is equal to INTRA_LT_CCLM, the following        applies:

numSampT=availT?nTbW:0  (353)

numSampL=availL?nTbH:0  (354)

-   -   Otherwise, the following applies:

numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0  (355)

numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0  (356)

The variable bCTUboundary is derived as follows:

bCTUboundary=(yTbY&(CtbSizeY−1)==0)?TRUE:FALSE.  (357)

The variable cntN and array pickPosN with N being replaced by L and T,are derived as follows:

-   -   The variable numIs4N is derived as follows:

numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1)  (358)

-   -   The variable startPosN is set equal to numSampN>>(2+numIs4N).    -   The variable pickStepN is set equal to Max(1,        numSampN>>(1+numIs4N)).    -   If availN is equal to TRUE and predModeIntra is equal to        INTRA_LT_CCLM or INTRA_N_CCLM, the following assignments are        made:        -   cntN is set equal to Min(numSampN, (1+numIs4N)<<1).        -   pickPosN[pos] is set equal to (startPosN+pos*pickStepN),            with pos=0 . . . cntN−1.    -   Otherwise, cntN is set equal to 0.        The prediction samples predSamples[x][y] with x=0 . . . nTbW−1,        y=0 . . . nTbH−1 are derived as follows:    -   If both numSampL and numSampT are equal to 0, the following        applies:

predSamples[x][y]=1<<(BitDepth−1)  (359)

-   -   Otherwise, the following ordered steps apply:        -   1. The collocated luma samples pY[x][y] with x=0 . . .            nTbW*SubWidthC−1, y=0 . . . nTbH*SubHeightC−1 are set equal            to the reconstructed luma samples prior to the deblocking            filter process at the locations (xTbY+x, yTbY+y).        -   2. The neighbouring luma samples pY[x][y] are derived as            follows:            -   When numSampL is greater than 0, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=0 . . .                SubHeightC*numSampL−1, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availT is equal to FALSE, the neighbouring top luma                samples pY[x][y] with x=−1 . . . SubWidthC*numSampT−1,                y=−1 . . . [[−2]]−                , are set equal to the luma samples pY[x][0].            -   When availL is equal to FALSE, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=−1 . . .                SubHeightC*numSampL−1, are set equal to the luma samples                pY[0][y].            -   When numSampT is greater than 0, the neighbouring top                luma samples pY[x][y] with x=0 . . .                SubWidthC*numSampT−1, y=−1 . . . −                [[−2]], are set equal to the reconstructed luma samples                prior to the deblocking filter process at the locations                (xTbY+x, yTbY+y).            -   When availTL is equal to TRUE, the neighbouring top-left                luma samples pY[x][y] with x=−1, y=−1, −2, are set equal                to the reconstructed luma samples prior to the                deblocking filter process at the locations (xTbY+x,                yTbY+y).        -   3. The down-sampled collocated luma samples pDsY[x][y] with            x=0 . . . nTbW−1, y=0 . . . nTbH−1 are derived as follows:            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:                -   pDsY[x][y] with x=1 . . . nTbW−1, y=1 . . . nTbH−1                    is derived as follows:

pDstY[x][y]=pY[x][y]  (360)

-   -   -   -   Otherwise, the following applies:                -   The one-dimensional filter coefficients array F1 and                    F2, and the 2-dimensional filter coefficients arrays                    F3 and F4 are specified as follows.

F1[0]=2,F1[1]=0  (361)

F2[0]=1,F2[1]=2,F2[2]=1  (362)

F3[i][j]=F4[i][j]=0,with i=0 . . . 2,j=0 . . . 2  (363)

-   -   -   -   -    If both SubWidthC and SubHeightC are equal to 2,                    the following applies:

F1[0]=1,F1[1]=1  (364)

F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1  (365)

F4[0][1]=1,F4[1][1]=2,F4[2][1]=1  (366)

F4[0][2]=1,F4[1][2]=2,F4[2][2]=1  (367)

-   -   -   -   -    Otherwise, the following applies:

F3[1][1]=8  (368)

F4[0][1]=2,F4[1][1]=4,F4[2][1]=2,  (369)

-   -   -   -   -   If sps_chromavertical_collocated_flag is equal to 1,                    the following applies:                -    pDsY[x][y] with x=0 . . . nTbW−1, y=0 . . . nTbH−1                    is derived as follows:

pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y−1]+F3[0][1]*pY[SubWidthC*x−1][SubHeightC*y]+F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3  (370)

-   -   -   -   -   Otherwise (sps_chroma_vertical_collocated_flag is                    equal to 0), the following applies:                -    pDsY[x][y] with x=0 . . . nTbW−1, y=0 . . . nTbH−1                    is derived as follows:

pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x−1][SubHeightC*y]+F4[0][2]*pY[SubWidthC*x−1][SubHeightC*y+1]+F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3  (371)

-   -   -   4. When numSampL is greater than 0, the selected            neighbouring left chroma samples pSelC[idx] are set equal to            p[−1][pickPosL[idx]] with idx=0 . . . cntL−1, and the            selected down-sampled neighbouring left luma samples            pSelDsY[idx] with idx=0 . . . cntL−1 are derived as follows:            -   The variable y is set equal to pickPosL[idx].            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:

pSelDsY[idx]=pY[−1][y]  (372)

-   -   -   -   Otherwise the following applies:                -   If sps_chroma_vertical_collocated_flag is equal to                    1, the following applies:

pSelDsY[idx]=(F3[1][0]*pY[−SubWidthC][SubHeightC*y−1]+F3[0][1]*pY[−1−SubWidthC][SubHeightC*y]+F3[1][1]*pY[−SubWidthC][SubHeightC*y]+F3[2][1]*pY[1−SubWidthC][SubHeightC*y]+F3[1][2]*pY[−SubWidthC][SubHeightC*y+1]+4)>>3  (373)

-   -   -   -   -   Otherwise (sps_chroma_vertical_collocated_flag is                    equal to 0), the following applies:

pSelDsY[idx]=(F4[0][1]*pY[−1−SubWidthC][SubHeightC*y]+F4[0][2]*pY[−1−SubWidthC][SubHeightC*y]+1+F4[1][1]*pY[−SubWidthC][SubHeightC*y]+F4[1][2]*pY[−SubWidthC][SubHeightC*y+1]+F4[2][1]*pY[1−SubWidthC][SubHeightC*y]+F4[2][2]*pY[1−SubWidthC][SubHeightC*y+1]+4)>>3  (374)

-   -   -   5. When numSampT is greater than 0, the selected            neighbouring top chroma samples pSelC[idx] are set equal to            p[pickPosT[idx−cntL]][−1] with idx=cntL . . . cntL+cntT−1,            and the down-sampled neighbouring top luma samples            pSelDsY[idx] with idx=0 . . . cntL+cntT−1 are specified as            follows:            -   The variable x is set equal to pickPosT[idx−cntL].            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:

pSelDsY[idx]=pY[x][−1]  (375)

-   -   -   -   Otherwise, the following applies:                -   If sps_chroma_vertical_collocated_flag is equal to                    1, the following applies:                -    If bCTUboundary is equal to FALSE, the following                    applies:

pSelDsY[idx]=(F3[1][0]*pY[SubWidthC*x][−1−SubHeightC]+F3[0][1]*pY[SubWidthC*x−1][−SubHeightC]+F3[1][1]*pY[SubWidthC*x][−SubHeightC]+F3[2][1]*pY[SubWidthC*x+1][−SubHeightC]+F3[1][2]*pY[SubWidthC*x][1−SubHeightC]+4)>>3  (376)

-   -   -   -   -    Otherwise (bCTUboundary is equal to TRUE), the                    following applies:

pSelDsY[idx]=(F2[0]*pY[SubWidthC*x−1][−1]+F2[1]*pY[SubWidthC*x][−1]+F2[2]*pY[SubWidthC*x+1][−1]+2)>>2  (377)

-   -   -   -   -    Otherwise (sps_chroma_vertical_collocated_flag is                    equal to 0), the following applies:                -    If bCTUboundary is equal to FALSE, the following                    applies:

pSelDsY[idx]=(F4[0][1]*pY[SubWidthCx−1][−1]+F4[0][2]*pY[SubWidthC*x−1][−2]+F4[1][1]*pY[SubWidthC*x][−1]+F4[1][2]*pY[SubWidthC*x][−2]+F4[2][1]*pY[SubWidthC*x+1][−1]+F4[2][2]*pY[SubWidthC*x+1][−2]+4)>>3  (378)

-   -   -   -   -    Otherwise (bCTUboundary is equal to TRUE), the                    following applies:

pSelDsY[idx]=(F2[0]*pY[SubWidthC*x−1][−1]+F2[1]*pY[SubWidthC*x][−1]+F2[2]*pY[SubWidthC*x+1][−1]+2)>>2  (379)

-   -   -   6. When cntT+cntL is not equal to 0, the variables minY,            maxY, minC and maxC are derived as follows:            -   When cntT+cntL is equal to 2, pSelComp[3] is set equal                to pSelComp[0], pSelComp[2] is set equal to pSelComp[1],                pSelComp[0] is set equal to pSelComp[1], and pSelComp[1]                is set equal to pSelComp[3], with Comp being replaced by                DsY and C.            -   The arrays minGrpIdx and maxGrpIdx are derived as                follows:

minGrpIdx[0]=0  (380)

minGrpIdx[1]=2  (381)

maxGrpIdx[0]=1  (382)

maxGrpIdx[1]=3  (383)

-   -   -   -   When pSelDsY[minGrpIdx[0]] is greater than                pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are                swapped as follows:

(minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1])  (384)

-   -   -   -   When pSelDsY[maxGrpIdx[0]] is greater than                pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are                swapped as follows:

(maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1])  (385)

-   -   -   -   When pSelDsY[minGrpIdx[0]] is greater than                pSelDsY[maxGrpIdx[1]], arrays minGrpIdx and maxGrpIdx                are swapped as follows:

(minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx)  (386)

-   -   -   -   When pSelDsY[minGrpIdx[1]] is greater than                pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are                swapped as follows:

(minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0])  (387)

-   -   -   -   The variables maxY, maxC, minY and minC are derived as                follows:

maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1  (388)

maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1  (389)

minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1  (390)

minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1  (391)

-   -   -   7. The variables a, b, and k are derived as follows:            -   If numSampL is equal to 0, and numSampT is equal to 0,                the following applies:

k=0  (392)

a=0  (393)

b=1<<(BitDepth−1)  (394)

-   -   -   -   Otherwise, the following applies:

diff=maxY−minY  (395)

-   -   -   -   -   If diff is not equal to 0, the following applies:

diffC=maxC−minC  (396)

x=Floor(Log 2(diff))  (397)

normDiff=((diff<<4)>>x)&15  (398)

x+=(normDiff!=0)?1:0  (399)

y=Abs(diffC)>0?Floor(Log 2(Abs(diffC)))+1:0  (400)

a=(diffC*(divSigTable[normDiff]|8)+2^(y-1))>>y  (401)

k=((3+x−y)<1)?1:3+x−y  (402)

a=((3+x−y)<1)?Sign(a)*15:a  (403)

b=minC−((a*minY)>>k)  (404)

-   -   -   -   -    where divSigTable[ ] is specified as follows:

divSigTable[ ]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0}  (405)

-   -   -   -   -   Otherwise (diff is equal to 0), the following                    applies:

k=0  (406)

a=0  (407)

b=minC  (408)

-   -   -   8. The prediction samples predSamples[x][y] with x=0 . . .            nTbW−1, y=0 . . . nTbH−1 are derived as follows:

predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b)  (409)

-   -   NOTE—This process uses sps_chroma_vertical_collocated_flag.        However, in order to simplify implementation, it does not use        sps_chroma_horizontal_collocated_flag.

5.8. Embodiment 8

The working draft specified in JVET-Q2001-vE may be changed as below.8.4.5.2.13Inputs to this process are:

-   -   the intra prediction mode predModeIntra,    -   a sample location (xTbC, yTbC) of the top-left sample of the        current transform block relative to the top-left sample of the        current picture,    -   a variable nTbW specifying the transform block width,    -   a variable nTbH specifying the transform block height,    -   a variable cIdx specifying the colour component of the current        block,    -   chroma neighbouring samples p[x][y], with x=−1, y=0 . . .        2*nTbH−1 and x=0 . . . 2*nTbW−1, y=−1.        Output of this process are predicted samples predSamples[x][y],        with x=0 . . . nTbW−1, y=0 . . . nTbH−1.        The current luma location (xTbY, yTbY) is derived as follows:

(xTbY,yTbY)=(xTbC<<(SubWidthC−1),yTbC<<(SubHeightC−1))  (351)

The variables availL, availT and availTL are derived as follows:

-   -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY−1, yTbY), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availL.    -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY, yTbY−1), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availT.    -   ,        ,        ,        ,        ,        .    -   The number of available top-right neighbouring chroma samples        numTopRight is derived as follows:        -   The variable numTopRight is set equal to 0 and availTR is            set equal to TRUE.        -   When predModeIntra is equal to INTRA_T_CCLM, the following            applies for x=nTbW . . . 2*nTbW−1 until availTR is equal to            FALSE or x is equal to 2*nTbW−1:            -   The derivation process for neighbouring block                availability as specified in clause 6.4.4 is invoked                with the current luma location (xCurr, yCurr) set equal                to (xTbY, yTbY) the neighbouring luma location (xTbY+x,                yTbY−1), checkPredModeY set equal to FALSE, and cIdx as                inputs, and the output is assigned to availTR            -   When availTR is equal to TRUE, numTopRight is                incremented by one.    -   The number of available left-below neighbouring chroma samples        numLeftBelow is derived as follows:        -   The variable numLeftBelow is set equal to 0 and availLB is            set equal to TRUE.        -   When predModeIntra is equal to INTRA_L_CCLM, the following            applies for y=nTbH . . . 2*nTbH−1 until availLB is equal to            FALSE or y is equal to 2*nTbH−1:            -   The derivation process for neighbouring block                availability as specified in clause 6.4.4 is invoked                with the current luma location (xCurr, yCurr) set equal                to (xTbY, yTbY), the neighbouring luma location (xTbY−1,                yTbY+y), checkPredModeY set equal to FALSE, and cIdx as                inputs, and the output is assigned to availLB            -   When availLB is equal to TRUE, numLeftBelow is                incremented by one.                The number of available neighbouring chroma samples on                the top and top-right numSampT and the number of                available neighbouring chroma samples on the left and                left-below numSampL are derived as follows:    -   If predModeIntra is equal to INTRA_LT_CCLM, the following        applies:

numSampT=availT?nTbW:0  (353)

numSampL=availL?nTbH:0  (354)

-   -   Otherwise, the following applies:

numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0  (355)

numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0  (356)

The variable bCTUboundary is derived as follows:

bCTUboundary=(yTbY&(CtbSizeY−1)==0)?TRUE:FALSE.  (357)

The variable cntN and array pickPosN with N being replaced by L and T,are derived as follows:

-   -   The variable numIs4N is derived as follows:

numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1)  (358)

-   -   The variable startPosN is set equal to numSampN>>(2+numIs4N).    -   The variable pickStepN is set equal to Max(1,        numSampN>>(1+numIs4N)).    -   If availN is equal to TRUE and predModeIntra is equal to        INTRA_LT_CCLM or INTRA_N_CCLM, the following assignments are        made:        -   cntN is set equal to Min(numSampN, (1+numIs4N)<<1).        -   pickPosN[pos] is set equal to (startPosN+pos*pickStepN),            with pos=0 . . . cntN−1.    -   Otherwise, cntN is set equal to 0.        The prediction samples predSamples[x][y] with x=0 . . . nTbW−1,        y=0 . . . nTbH−1 are derived as follows:    -   If both numSampL and numSampT are equal to 0, the following        applies:

predSamples[x][y]=1<<(BitDepth−1)  (359)

-   -   Otherwise, the following ordered steps apply:        -   1. The collocated luma samples pY[x][y] with x=0 . . .            nTbW*SubWidthC−1, y=0 . . . nTbH*SubHeightC−1 are set equal            to the reconstructed luma samples prior to the deblocking            filter process at the locations (xTbY+x, yTbY+y).        -   2. The neighbouring luma samples pY[x][y] are derived as            follows:            -   When numSampL is greater than 0, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=0 . . .                SubHeightC*numSampL−1, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availT is equal to FALSE, the neighbouring top luma                samples pY[x][y] with x=−1 . . . SubWidthC*numSampT−1,                y=−1 . . . −2, are set equal to the luma samples                pY[x][0].            -   When availL is equal to FALSE, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=−1 . . .                SubHeightC*numSampL−1, are set equal to the luma samples                pY[0][y].            -   When numSampT is greater than 0, the neighbouring top                luma samples pY[x][y] with x=0 . . .                SubWidthC*numSampT−1, y=−1, −2, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   If availTL is equal to TRUE, the neighbouring top-left                luma samples pY[x][y] with x=−1, −2, y=−1, −2 are set                equal to the reconstructed luma samples prior to the                deblocking filter process at the locations (xTbY+x,                yTbY+y).            -   ,                ,                ,                ,                ,                ,            -   ,                ,                ,                ,                ,                ,                .        -   3. The down-sampled collocated luma samples pDsY[x][y] with            x=0 . . . nTbW−1, y=0 . . . nTbH−1 are derived as follows:            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:                -   pDsY[x][y] with x=1 . . . nTbW−1, y=1 . . . nTbH−1                    is derived as follows:

pDstY[x][y]=pY[x][y]  (360)

-   -   -   -   Otherwise, the following applies:                -   The one-dimensional filter coefficients array F1 and                    F2, and the 2-dimensional filter coefficients arrays                    F3 and F4 are specified as follows.

F1[0]=2,F1[1]=0  (361)

F2[0]=1,F2[1]=2,F2[2]=1  (362)

F3[i][j]=F4[i][j]=0,with i=0 . . . 2,j=0 . . . 2  (363)

-   -   -   -   -    If both SubWidthC and SubHeightC are equal to 2,                    the following applies:

F1[0]=1,F1[1]=1  (364)

F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1  (365)

F4[0][1]=1,F4[1][1]=2,F4[2][1]=1  (366)

F4[0][2]=1,F4[1][2]=2,F4[2][2]=1  (367)

-   -   -   -   -    Otherwise, the following applies:

F3[1][1]=8  (368)

F4[0][1]=2,F4[1][1]=4,F4[2][1]=2,  (369)

-   -   -   -   -   If sps_chroma_vertical_collocated_flag is equal to                    1, the following applies:                -    pDsY[x][y] with x=0 . . . nTbW−1, y=0 . . . nTbH−1                    is derived as follows:

pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y−1]+F3[0][1]*pY[SubWidthC*x−1][SubHeightC*y]+F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3  (370)

-   -   -   -   -   Otherwise (sps_chroma_vertical_collocated_flag is                    equal to 0), the following applies:                -    pDsY[x][y] with x=0 . . . nTbW−1, y=0 . . . nTbH−1                    is derived as follows:

pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x−1][SubHeightC*y]+F4[0][2]*pY[SubWidthC*x−1][SubHeightC*y+1]+F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3  (371)

-   -   -   4. When numSampL is greater than 0, the selected            neighbouring left chroma samples pSelC[idx] are set equal to            p[−1][pickPosL[idx]] with idx=0 . . . cntL−1, and the            selected down-sampled neighbouring left luma samples            pSelDsY[idx] with idx=0 . . . cntL−1 are derived as follows:            -   The variable y is set equal to pickPosL[idx].            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:

pSelDsY[idx]=pY[−1][y]  (372)

-   -   -   -   Otherwise the following applies:                -   If sps_chroma_vertical_collocated_flag is equal to                    1, the following applies:

pSelDsY[idx]=(F3[1][0]*pY[−SubWidthC][SubHeightC*y−1]+F3[0][1]*pY[−1−SubWidthC][SubHeightC*y]+F3[1][1]*pY[−SubWidthC][SubHeightC*y]+F3[2][1]*pY[1−SubWidthC][SubHeightC*y]+F3[1][2]*pY[−SubWidthC][SubHeightC*y+1]+4)>>3  (373)

-   -   -   -   -   Otherwise (sps_chroma_vertical_collocated_flag is                    equal to 0), the following applies:

pSelDsY[idx]=(F4[0][1]*pY[−1−SubWidthC][SubHeightC*y]+F4[0][2]*pY[−1−SubWidthC][SubHeightC*y]+1+F4[1][1]*pY[−SubWidthC][SubHeightC*y]+F4[1][2]*pY[−SubWidthC][SubHeightC*y+1]+F4[2][1]*pY[1−SubWidthC][SubHeightC*y]+F4[2][2]*pY[1−SubWidthC][SubHeightC*y+1]+4)>>3  (374)

-   -   -   5. When numSampT is greater than 0, the selected            neighbouring top chroma samples pSelC[idx] are set equal to            p[pickPosT[idx−cntL]][−1] with idx=cntL . . . cntL+cntT−1,            and the down-sampled neighbouring top luma samples            pSelDsY[idx] with idx=0 . . . cntL+cntT−1 are specified as            follows:            -   The variable x is set equal to pickPosT[idx−cntL].            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:

pSelDsY[idx]=pY[x][−1]  (375)

-   -   -   -   Otherwise, the following applies:                -   If sps_chroma_vertical_collocated_flag is equal to                    1, the following applies:                -    If bCTUboundary is equal to FALSE, the following                    applies:

pSelDsY[idx]=(F3[1][0]*pY[SubWidthC*x][−1−SubHeightC]+F3[0][1]*pY[SubWidthC*x−1][−SubHeightC]+F3[1][1]*pY[SubWidthC*x][−SubHeightC]+F3[2][1]*pY[SubWidthC*x+1][−SubHeightC]+F3[1][2]*pY[SubWidthC*x][1−SubHeightC]+4)>>3  (376)

-   -   -   -   -    Otherwise (bCTUboundary is equal to TRUE), the                    following applies:

pSelDsY[idx]=(F2[0]*pY[SubWidthC*x−1][−1]+F2[1]*pY[SubWidthC*x][−1]+F2[2]*pY[SubWidthC*x+1][−1]+2)>>2  (377)

-   -   -   -   -    Otherwise (sps_chroma_vertical_collocated_flag is                    equal to 0), the following applies:                -    If bCTUboundary is equal to FALSE, the following                    applies:

pSelDsY[idx]=(F4[0][1]*pY[SubWidthCx−1][−1]+F4[0][2]*pY[SubWidthC*x−1][−2]+F4[1][1]*pY[SubWidthC*x][−1]+F4[1][2]*pY[SubWidthC*x][−2]+F4[2][1]*pY[SubWidthC*x+1][−1]+F4[2][2]*pY[SubWidthC*x+1][−2]+4)>>3  (378)

-   -   -   -   -    Otherwise (bCTUboundary is equal to TRUE), the                    following applies:

pSelDsY[idx]=(F2[0]*pY[SubWidthC*x−1][−1]+F2[1]*pY[SubWidthC*x][−1]+F2[2]*pY[SubWidthC*x+−1]+2)>>2  (379)

-   -   -   6. When cntT+cntL is not equal to 0, the variables minY,            maxY, minC and maxC are derived as follows:            -   When cntT+cntL is equal to 2, pSelComp[3] is set equal                to pSelComp[0], pSelComp[2] is set equal to pSelComp[1],                pSelComp[0] is set equal to pSelComp[1], and pSelComp[1]                is set equal to pSelComp[3], with Comp being replaced by                DsY and C.            -   The arrays minGrpIdx and maxGrpIdx are derived as                follows:

minGrpIdx[0]=0  (380)

minGrpIdx[1]=2  (381)

maxGrpIdx[0]=1  (382)

maxGrpIdx[1]=3  (383)

-   -   -   -   When pSelDsY[minGrpIdx[0]] is greater than                pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are                swapped as follows:

(minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1])  (384)

-   -   -   -   When pSelDsY[maxGrpIdx[0]] is greater than                pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are                swapped as follows:

(maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1])  (385)

-   -   -   -   When pSelDsY[minGrpIdx[0]] is greater than                pSelDsY[maxGrpIdx[1]], arrays minGrpIdx and maxGrpIdx                are swapped as follows:

(minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx)  (386)

-   -   -   -   When pSelDsY[minGrpIdx[1]] is greater than                pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are                swapped as follows:

(minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0])  (387)

-   -   -   -   The variables maxY, maxC, minY and minC are derived as                follows:

maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1  (388)

maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1  (389)

minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1  (390)

minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1  (391)

-   -   -   7. The variables a, b, and k are derived as follows:            -   If numSampL is equal to 0, and numSampT is equal to 0,                the following applies:

k=0  (392)

a=0  (393)

b=1<<(BitDepth−1)  (394)

-   -   -   -   Otherwise, the following applies:

diff=maxY−minY  (395)

-   -   -   -   -   If diff is not equal to 0, the following applies:

diffC=maxC−minC  (396)

x=Floor(Log 2(diff))  (397)

normDiff=((diff<<4)>>x)&15  (398)

x+=(normDiff!=0)?1:0  (399)

y=Abs(diffC)>0?Floor(Log 2(Abs(diffC)))+1:0  (400)

a=(diffC*(divSigTable[normDiff]|8)+2^(y-1))>>y  (401)

k=((3+x−y)<1)?1:3+x−y  (402)

a=((3+x−y)<1)?Sign(a)*15:a  (403)

b=minC−((a*minY)>>k)  (404)

-   -   -   -   -    where divSigTable[ ] is specified as follows:

divSigTable[ ]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0}  (405)

-   -   -   -   -   Otherwise (diff is equal to 0), the following                    applies:

k=0  (406)

a=0  (407)

b=minC  (408)

-   -   -   8. The prediction samples predSamples[x][y] with x=0 . . .            nTbW−1, y=0 . . . nTbH−1 are derived as follows:

predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b)  (409)

-   -   NOTE—This process uses sps_chroma_vertical_collocated_flag.        However, in order to simplify implementation, it does not use        sps_chroma_horizontal_collocated_flag.

5.9. Embodiment 9

The working draft specified in JVET-Q2001-vE may be changed as below.8.4.5.2.13Inputs to this process are:

-   -   the intra prediction mode predModeIntra,    -   a sample location (xTbC, yTbC) of the top-left sample of the        current transform block relative to the top-left sample of the        current picture,    -   a variable nTbW specifying the transform block width,    -   a variable nTbH specifying the transform block height,    -   a variable cIdx specifying the colour component of the current        block,    -   chroma neighbouring samples p[x][y], with x=−1, y=0 . . .        2*nTbH−1 and x=0 . . . 2*nTbW−1, y=−1.        Output of this process are predicted samples predSamples[x][y],        with x=0 . . . nTbW−1, y=0 . . . nTbH−1.        The current luma location (xTbY, yTbY) is derived as follows:

(xTbY,yTbY)=(xTbC<<(SubWidthC−1),yTbC<<(SubHeightC−1))  (351)

The variables availL, availT and availTL are derived as follows:

-   -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY−1, yTbY), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availL.    -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY, yTbY−1), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availT.    -   The variable availTL is derived as follows:

availTL=availL&&availT  (352)

-   -   The number of available top-right neighbouring chroma samples        numTopRight is derived as follows:        -   The variable numTopRight is set equal to 0 and availTR is            set equal to TRUE.        -   When predModeIntra is equal to INTRA_T_CCLM, the following            applies for x=nTbW . . . 2*nTbW−1 until availTR is equal to            FALSE or x is equal to 2*nTbW−1:            -   The derivation process for neighbouring block                availability as specified in clause 6.4.4 is invoked                with the current luma location (xCurr, yCurr) set equal                to (xTbY, yTbY) the neighbouring luma location (xTbY+x,                yTbY−1), checkPredModeY set equal to FALSE, and cIdx as                inputs, and the output is assigned to availTR            -   When availTR is equal to TRUE, numTopRight is                incremented by one.    -   The number of available left-below neighbouring chroma samples        numLeftBelow is derived as follows:        -   The variable numLeftBelow is set equal to 0 and availLB is            set equal to TRUE.        -   When predModeIntra is equal to INTRA_L_CCLM, the following            applies for y=nTbH . . . 2*nTbH−1 until availLB is equal to            FALSE or y is equal to 2*nTbH−1:            -   The derivation process for neighbouring block                availability as specified in clause 6.4.4 is invoked                with the current luma location (xCurr, yCurr) set equal                to (xTbY, yTbY), the neighbouring luma location (xTbY−1,                yTbY+y), checkPredModeY set equal to FALSE, and cIdx as                inputs, and the output is assigned to availLB            -   When availLB is equal to TRUE, numLeftBelow is                incremented by one.                The number of available neighbouring chroma samples on                the top and top-right numSampT and the number of                available neighbouring chroma samples on the left and                left-below numSampL are derived as follows:    -   If predModeIntra is equal to INTRA_LT_CCLM, the following        applies:

numSampT=availT?nTbW:0  (353)

numSampL=availL?nTbH:0  (354)

-   -   Otherwise, the following applies:

numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0  (355)

numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0  (356)

The variable bCTUboundary is derived as follows:

bCTUboundary=(yTbY&(CtbSizeY−1)==0)?TRUE:FALSE.  (357)

The variable cntN and array pickPosN with N being replaced by L and T,are derived as follows:

-   -   The variable numIs4N is derived as follows:

numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1)  (358)

-   -   The variable startPosN is set equal to numSampN>>(2+numIs4N).    -   The variable pickStepN is set equal to Max(1,        numSampN>>(1+numIs4N)).    -   If availN is equal to TRUE and predModeIntra is equal to        INTRA_LT_CCLM or INTRA_N_CCLM, the following assignments are        made:        -   cntN is set equal to Min(numSampN, (1+numIs4N)<<1).        -   pickPosN[pos] is set equal to (startPosN+pos*pickStepN),            with pos=0 . . . cntN−1.    -   Otherwise, cntN is set equal to 0.        The prediction samples predSamples[x][y] with x=0 . . . nTbW−1,        y=0 . . . nTbH−1 are derived as follows:    -   If both numSampL and numSampT are equal to 0, the following        applies:

predSamples[x][y]=1<<(BitDepth−1)  (359)

-   -   Otherwise, the following ordered steps apply:        -   1. The collocated luma samples pY[x][y] with x=0 . . .            nTbW*SubWidthC−1, y=0 . . . nTbH*SubHeightC−1 are set equal            to the reconstructed luma samples prior to the deblocking            filter process at the locations (xTbY+x, yTbY+y).        -   2. The neighbouring luma samples pY[x][y] are derived as            follows:            -   When numSampL is greater than 0, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=0 . . .                SubHeightC*numSampL−1, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availT is equal to FALSE, the neighbouring top luma                samples pY[x][y] with x=−1 . . . SubWidthC*[[numSampT]]                −1, y=−1 . . . −2, are set equal to the luma samples                pY[x][0].            -   When numSampT is greater than 0, the neighbouring top                luma samples pY[x][y] with x=0 . . .                SubWidthC*numSampT−1, y=−1, −2, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   ,                ,                ,                .            -   When availTL is equal to TRUE, the neighbouring top-left                luma samples pY[x][y] with x=−1, y=−1, −2 are set equal                to the reconstructed luma samples prior to the                deblocking filter process at the locations (xTbY+x,                yTbY+y).        -   3. The down-sampled collocated luma samples pDsY[x][y] with            x=0 . . . nTbW−1, y=0 . . . nTbH−1 are derived as follows:            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:                -   pDsY[x][y] with x=1 . . . nTbW−1, y=1 . . . nTbH−1                    is derived as follows:

pDstY[x][y]=pY[x][y]  (360)

-   -   -   -   Otherwise, the following applies:                -   The one-dimensional filter coefficients array F1 and                    F2, and the 2-dimensional filter coefficients arrays                    F3 and F4 are specified as follows.

F1[0]=2,F1[1]=0  (361)

F2[0]=1,F2[1]=2,F2[2]=1  (362)

F3[i][j]=F4[i][j]=0,with i=0 . . . 2,j=0 . . . 2  (363)

-   -   -   -   -    If both SubWidthC and SubHeightC are equal to 2,                    the following applies:

F1[0]=1,F1[1]=1  (364)

F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1  (365)

F4[0][1]=1,F4[1][1]=2,F4[2][1]=1  (366)

F4[0][2]=1,F4[1][2]=2,F4[2][2]=1  (367)

-   -   -   -   -    Otherwise, the following applies:

F3[1][1]=8  (368)

F4[0][1]=2,F4[1][1]=4,F4[2][1]=2,  (369)

-   -   -   -   -   If sps_chroma_vertical_collocated_flag is equal to                    1, the following applies:                -    pDsY[x][y] with x=0 . . . nTbW−1, y=0 . . . nTbH−1                    is derived as follows:

pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y−1]+F3[0][1]*pY[SubWidthC*x−1][SubHeightC*y]+F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3  (370)

-   -   -   -   -   Otherwise (sps_chroma_vertical_collocated_flag is                    equal to 0), the following applies:                -    pDsY[x][y] with x=0 . . . nTbW−1, y=0 . . . nTbH−1                    is derived as follows:

pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x−1][SubHeightC*y]+F4[0][2]*pY[SubWidthC*x−1][SubHeightC*y+1]+F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3  (371)

-   -   -   4. When numSampL is greater than 0, the selected            neighbouring left chroma samples pSelC[idx] are set equal to            p[−1][pickPosL[idx]] with idx=0 . . . cntL−1, and the            selected down-sampled neighbouring left luma samples            pSelDsY[idx] with idx=0 . . . cntL−1 are derived as follows:            -   The variable y is set equal to pickPosL[idx].            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:

pSelDsY[idx]=pY[−1][y]  (372)

-   -   -   -   Otherwise the following applies:                -   If sps_chroma_vertical_collocated_flag is equal to                    1, the following applies:

pSelDsY[idx]=(F3[1][0]*pY[−SubWidthC][SubHeightC*y−1]+F3[0][1]*pY[−1−SubWidthC][SubHeightC*y]+F3[1][1]*pY[−SubWidthC][SubHeightC*y]+F3[2][1]*pY[1−SubWidthC][SubHeightC*y]+F3[1][2]*pY[−SubWidthC][SubHeightC*y+1]+4)>>3  (373)

-   -   -   -   -   Otherwise (sps_chroma_vertical_collocated_flag is                    equal to 0), the following applies:

pSelDsY[idx]=(F4[0][1]*pY[−1−SubWidthC][SubHeightC*y]+F4[0][2]*pY[−1−SubWidthC][SubHeightC*y]+1+F4[1][1]*pY[−SubWidthC][SubHeightC*y]+F4[1][2]*pY[−SubWidthC][SubHeightC*y+1]+F4[2][1]*pY[1−SubWidthC][SubHeightC*y]+F4[2][2]*pY[1−SubWidthC][SubHeightC*y+1]+4)>>3  (374)

-   -   -   5. When numSampT is greater than 0, the selected            neighbouring top chroma samples pSelC[idx] are set equal to            p[pickPosT[idx−cntL]][−1] with idx=cntL . . . cntL+cntT−1,            and the down-sampled neighbouring top luma samples            pSelDsY[idx] with idx=0 . . . cntL+cntT−1 are specified as            follows:            -   The variable x is set equal to pickPosT[idx−cntL].            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:

pSelDsY[idx]=pY[x][−1]  (375)

-   -   -   -   Otherwise, the following applies:                -   If sps_chroma_vertical_collocated_flag is equal to                    1, the following applies:                -    If bCTUboundary is equal to FALSE, the following                    applies:

pSelDsY[idx]=(F3[1][0]*pY[SubWidthC*x][−1−SubHeightC]+F3[0][1]*pY[SubWidthC*x−1][−SubHeightC]+F3[1][1]*pY[SubWidthC*x][−SubHeightC]+F3[2][1]*pY[SubWidthC*x+1][−SubHeightC]+F3[1][2]*pY[SubWidthC*x][1−SubHeightC]+4)>>3  (376)

-   -   -   -   -    Otherwise (bCTUboundary is equal to TRUE), the                    following applies:

pSelDsY[idx]=(F2[0]*pY[SubWidthC*x−1][−1]+F2[1]*pY[SubWidthC*x][−1]+F2[2]*pY[SubWidthC*x+1][−1]+2)>>2  (377)

-   -   -   -   -   Otherwise (sps_chroma_vertical_collocated_flag is                    equal to 0), the following applies:                -    If bCTUboundary is equal to FALSE, the following                    applies:

pSelDsY[idx]=(F4[0][1]*pY[SubWidthCx−1][−1]+F4[0][2]*pY[SubWidthC*x−1][−2]+F4[1][1]*pY[SubWidthC*x][−1]+F4[1][2]*pY[SubWidthC*x][−2]+F4[2][1]*pY[SubWidthC*x+1][−1]+F4[2][2]*pY[SubWidthC*x+1][−2]+4)>>3  (378)

-   -   -   -   -    Otherwise (bCTUboundary is equal to TRUE), the                    following applies:

pSelDsY[idx]=(F2[0]*pY[SubWidthC*x−1][−1]+F2[1]*pY[SubWidthC*x][−1]+F2[2]*pY[SubWidthC*x+1][−1]+2)>>2  (379)

-   -   -   6. When cntT+cntL is not equal to 0, the variables minY,            maxY, minC and maxC are derived as follows:            -   When cntT+cntL is equal to 2, pSelComp[3] is set equal                to pSelComp[0], pSelComp[2] is set equal to pSelComp[1],                pSelComp[0] is set equal to pSelComp[1], and pSelComp[1]                is set equal to pSelComp[3], with Comp being replaced by                DsY and C.            -   The arrays minGrpIdx and maxGrpIdx are derived as                follows:

minGrpIdx[0]=0  (380)

minGrpIdx[1]=2  (381)

maxGrpIdx[0]=1  (382)

maxGrpIdx[1]=3  (383)

-   -   -   -   When pSelDsY[minGrpIdx[0]] is greater than                pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are                swapped as follows:

(minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1])  (384)

-   -   -   -   When pSelDsY[maxGrpIdx[0]] is greater than                pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are                swapped as follows:

(maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1])  (385)

When pSelDsY[minGrpIdx[0]] is greater than pSelDsY[maxGrpIdx[1]], arraysminGrpIdx and maxGrpIdx are swapped as follows:

(minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx)  (386)

-   -   -   -   When pSelDsY[minGrpIdx[1]] is greater than                pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are                swapped as follows:

(minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0])  (387)

-   -   -   -   The variables maxY, maxC, minY and minC are derived as                follows:

maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1  (388)

maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1  (389)

minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1  (390)

minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1  (391)

-   -   -   7. The variables a, b, and k are derived as follows:            -   If numSampL is equal to 0, and numSampT is equal to 0,                the following applies:

k=0  (392)

a=0  (393)

b=1<<(BitDepth−1)  (394)

-   -   -   -   Otherwise, the following applies:

diff=maxY−minY  (395)

-   -   -   -   -   If diff is not equal to 0, the following applies:

diffC=maxC−minC  (396)

x=Floor(Log 2(diff))  (397)

normDiff=((diff<<4)>>x)&15  (398)

x+=(normDiff!=0)?1:0  (399)

y=Abs(diffC)>0?Floor(Log 2(Abs(diffC)))+1:0  (400)

a=(diffC*(divSigTable[normDiff]|8)+2^(y-1))>>y  (401)

k=((3+x−y)<1)?1:3+x−y  (402)

a=((3+x−y)<1)?Sign(a)*15:a  (403)

b=minC−((a*minY)>>k)  (404)

-   -   -   -   -    where divSigTable[ ] is specified as follows:

divSigTable[ ]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0}  (405)

-   -   -   -   -   Otherwise (diff is equal to 0), the following                    applies:

k=0  (406)

a=0  (407)

b=minC  (408)

-   -   -   8. The prediction samples predSamples[x][y] with x=0 . . .            nTbW−1, y=0 . . . nTbH−1 are derived as follows:

predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b)  (409)

-   -   NOTE—This process uses sps_chroma_vertical_collocated_flag.        However, in order to simplify implementation, it does not use        sps_chroma_horizontal_collocated_flag.

5.10. Embodiment 10

The working draft specified in JVET-Q2001-vE may be changed as below.8.4.5.2.13Inputs to this process are:

-   -   the intra prediction mode predModeIntra,    -   a sample location (xTbC, yTbC) of the top-left sample of the        current transform block relative to the top-left sample of the        current picture,    -   a variable nTbW specifying the transform block width,    -   a variable nTbH specifying the transform block height,    -   a variable cIdx specifying the colour component of the current        block,    -   chroma neighbouring samples p[x][y], with x=−1, y=0 . . .        2*nTbH−1 and x=0 . . . 2*nTbW−1, y=−1.        Output of this process are predicted samples predSamples[x][y],        with x=0 . . . nTbW−1, y=0 . . . nTbH−1.        The current luma location (xTbY, yTbY) is derived as follows:

(xTbY,yTbY)=(xTbC<<(SubWidthC−1),yTbC<<(SubHeightC−1))  (351)

The variables availL, availT and availTL are derived as follows:

-   -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY−1, yTbY), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availL.    -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY, yTbY−1), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availT.    -   ,        ,        ,        ,        .    -   The number of available top-right neighbouring chroma samples        numTopRight is derived as follows:        -   The variable numTopRight is set equal to 0 and availTR is            set equal to TRUE.        -   When predModeIntra is equal to INTRA_T_CCLM, the following            applies for x=nTbW . . . 2*nTbW−1 until availTR is equal to            FALSE or x is equal to 2*nTbW−1:            -   The derivation process for neighbouring block                availability as specified in clause 6.4.4 is invoked                with the current luma location (xCurr, yCurr) set equal                to (xTbY, yTbY) the neighbouring luma location (xTbY+x,                yTbY−1), checkPredModeY set equal to FALSE, and cIdx as                inputs, and the output is assigned to availTR            -   When availTR is equal to TRUE, numTopRight is                incremented by one.    -   The number of available left-below neighbouring chroma samples        numLeftBelow is derived as follows:        -   The variable numLeftBelow is set equal to 0 and availLB is            set equal to TRUE.        -   When predModeIntra is equal to INTRA_L_CCLM, the following            applies for y=nTbH . . . 2*nTbH−1 until availLB is equal to            FALSE or y is equal to 2*nTbH−1:            -   The derivation process for neighbouring block                availability as specified in clause 6.4.4 is invoked                with the current luma location (xCurr, yCurr) set equal                to (xTbY, yTbY), the neighbouring luma location (xTbY−1,                yTbY+y), checkPredModeY set equal to FALSE, and cIdx as                inputs, and the output is assigned to availLB            -   When availLB is equal to TRUE, numLeftBelow is                incremented by one.                The number of available neighbouring chroma samples on                the top and top-right numSampT and the number of                available neighbouring chroma samples on the left and                left-below numSampL are derived as follows:    -   If predModeIntra is equal to INTRA_LT_CCLM, the following        applies:

numSampT=availT?nTbW:0  (353)

numSampL=availL?nTbH:0  (354)

-   -   Otherwise, the following applies:

numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0  (355)

numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0  (356)

The variable bCTUboundary is derived as follows:

bCTUboundary=(yTbY&(CtbSizeY−1)==0)?TRUE:FALSE.  (357)

The variable cntN and array pickPosN with N being replaced by L and T,are derived as follows:

-   -   The variable numIs4N is derived as follows:

numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1)  (358)

-   -   The variable startPosN is set equal to numSampN>>(2+numIs4N).    -   The variable pickStepN is set equal to Max(1,        numSampN>>(1+numIs4N)).    -   If availN is equal to TRUE and predModeIntra is equal to        INTRA_LT_CCLM or INTRA_N_CCLM, the following assignments are        made:        -   cntN is set equal to Min(numSampN, (1+numIs4N)<<1).        -   pickPosN[pos] is set equal to (startPosN+pos*pickStepN),            with pos=0 . . . cntN−1.    -   Otherwise, cntN is set equal to 0.        The prediction samples predSamples[x][y] with x=0 . . . nTbW−1,        y=0 . . . nTbH−1 are derived as follows:    -   If both numSampL and numSampT are equal to 0, the following        applies:

predSamples[x][y]=1<<(BitDepth−1)  (359)

-   -   Otherwise, the following ordered steps apply:        -   1. The collocated luma samples pY[x][y] with x=0 . . .            nTbW*SubWidthC−1, y=0 . . . nTbH*SubHeightC−1 are set equal            to the reconstructed luma samples prior to the deblocking            filter process at the locations (xTbY+x, yTbY+y).        -   2. The neighbouring luma samples pY[x][y] are derived as            follows:            -   When numSampL is greater than 0, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=0 . . .                SubHeightC*numSampL−1, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).

            -   When numSampT is greater than 0, the neighbouring top                luma samples pY[x][y] with x=0 . . .                SubWidthC*numSampT−1, y=−1, −2, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).

            -   If availTL is equal to TRUE, the neighbouring top-left                luma samples pY[x][y] with x=−1, −2, y=−1, −2 are set                equal to the reconstructed luma samples prior to the                deblocking filter process at the locations (xTbY+x,                yTbY+y).

            -   ,                ,                ,                ,                ,                ,                .

            -   ,                ,                ,                ,                ,                ,                .

            -   

            -   ,                ,                .        -   3. The down-sampled collocated luma samples pDsY[x][y] with            x=0 . . . nTbW−1, y=0 . . . nTbH−1 are derived as follows:            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:                -   pDsY[x][y] with x=1 . . . nTbW−1, y=1 . . . nTbH−1                    is derived as follows:

pDstY[x][y]=pY[x][y]  (360)

-   -   -   -   Otherwise, the following applies:                -   The one-dimensional filter coefficients array F1 and                    F2, and the 2-dimensional filter coefficients arrays                    F3 and F4 are specified as follows.

F1[0]=2,F1[1]=0  (361)

F2[0]=1,F2[1]=2,F2[2]=1  (362)

F3[i][j]=F4[i][j]=0,with i=0 . . . 2,j=0 . . . 2  (363)

-   -   -   -   -    If both SubWidthC and SubHeightC are equal to 2,                    the following applies:

F1[0]=1,F1[1]=1  (364)

F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[2]=1  (365)

F4[0][1]=1,F4[1][1]=2,F4[2][1]=1  (366)

F4[0][2]=1,F4[1][2]=2,F4[2][2]=1  (367)

-   -   -   -   -    Otherwise, the following applies:

F3[1][1]=8  (368)

F4[0][1]=2,F4[1][1]=4,F4[2][1]=2,  (369)

-   -   -   -   -   If sps_chroma_vertical_collocated_flag is equal to                    1, the following applies:                -    pDsY[x][y] with x=0 . . . nTbW−1, y=0 . . . nTbH−1                    is derived as follows:

pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y−1]+F3[0][1]*pY[SubWidthC*x−1][SubHeightC*y]+F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3  (370)

-   -   -   -   -   Otherwise (sps_chroma_vertical_collocated_flag is                    equal to 0), the following applies:                -    pDsY[x][y] with x=0 . . . nTbW−1, y=0 . . . nTbH−1                    is derived as follows:

pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x−1][SubHeightC*y]+F4[0][2]*pY[SubWidthC*x−1][SubHeightC*y+1]+F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3  (371)

-   -   -   4. When numSampL is greater than 0, the selected            neighbouring left chroma samples pSelC[idx] are set equal to            p[−1][pickPosL[idx]] with idx=0 . . . cntL−1, and the            selected down-sampled neighbouring left luma samples            pSelDsY[idx] with idx=0 . . . cntL−1 are derived as follows:            -   The variable y is set equal to pickPosL[idx].            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:

pSelDsY[idx]=pY[−1][y]  (372)

-   -   -   -   Otherwise the following applies:                -   If sps_chroma_vertical_collocated_flag is equal to                    1, the following applies:

pSelDsY[idx]=(F3[1][0]*pY[−SubWidthC][SubHeightC*y−1]+F3[0][1]*pY[−1−SubWidthC][SubHeightC*y]+F3[1][1]*pY[−SubWidthC][SubHeightC*y]+F3[2][1]*pY[1−SubWidthC][SubHeightC*y]+F3[1][2]*pY[−SubWidthC][SubHeightC*y+1]+4)>>3  (373)

-   -   -   -   -   Otherwise (sps_chroma_vertical_collocated_flag is                    equal to 0), the following applies:

pSelDsY[idx]=(F4[0][1]*pY[−1−SubWidthC][SubHeightC*y]+F4[0][2]*pY[−1−SubWidthC][SubHeightC*y]+1+F4[1][1]*pY[−SubWidthC][SubHeightC*y]+F4[1][2]*pY[−SubWidthC][SubHeightC*y+1]+F4[2][1]*pY[1−SubWidthC][SubHeightC*y]+F4[2][2]*pY[1−SubWidthC][SubHeightC*y+1]+4)>>3  (374)

-   -   -   5. When numSampT is greater than 0, the selected            neighbouring top chroma samples pSelC[idx] are set equal to            p[pickPosT[idx−cntL]][−1] with idx=cntL . . . cntL+cntT−1,            and the down-sampled neighbouring top luma samples            pSelDsY[idx] with idx=0 . . . cntL+cntT−1 are specified as            follows:            -   The variable x is set equal to pickPosT[idx−cntL].            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:

pSelDsY[idx]=pY[x][−1]  (375)

-   -   -   -   Otherwise, the following applies:                -   If sps_chroma_vertical_collocated_flag is equal to                    1, the following applies:                -    If bCTUboundary is equal to FALSE, the following                    applies:

pSelDsY[idx]=(F3[1][0]*pY[SubWidthC*x][−1−SubHeightC]+F3[0][1]*pY[SubWidthC*x−1][−SubHeightC]+F3[1][1]*pY[SubWidthC*x][−SubHeightC]+F3[2][1]*pY[SubWidthC*x+1][−SubHeightC]+F3[1][2]*pY[SubWidthC*x][1−SubHeightC]+4)>>3  (376)

-   -   -   -   -    Otherwise (bCTUboundary is equal to TRUE), the                    following applies:

pSelDsY[idx]=(F2[0]*pY[SubWidthC*x−1][−1]+F2[1]*pY[SubWidthC*x][−1]+F2[2]*pY[SubWidthC*x+1][−1]+2)>>2  (377)

-   -   -   -   -   Otherwise (sps_chroma_vertical_collocated_flag is                    equal to 0), the following applies:                -    If bCTUboundary is equal to FALSE, the following                    applies:

pSelDsY[idx]=(F4[0][1]*pY[SubWidthCx−1][−1]+F4[0][2]*pY[SubWidthC*x−1][−2]+F4[1][1]*pY[SubWidthC*x][−1]+F4[1][2]*pY[SubWidthC*x][−2]+F4[2][1]*pY[SubWidthC*x+1][−1]+F4[2][2]*pY[SubWidthC*x+1][−2]+4)>>3  (378)

-   -   -   -   -    Otherwise (bCTUboundary is equal to TRUE), the                    following applies:

pSelDsY[idx]=(F2[0]*pY[SubWidthC*x−1][−1]+F2[1]*pY[SubWidthC*x][−1]+F2[2]*pY[SubWidthC*x+1][−1]+2)>>2  (379)

-   -   -   6. When cntT+cntL is not equal to 0, the variables minY,            maxY, minC and maxC are derived as follows:            -   When cntT+cntL is equal to 2, pSelComp[3] is set equal                to pSelComp[0], pSelComp[2] is set equal to pSelComp[1],                pSelComp[0] is set equal to pSelComp[1], and pSelComp[1]                is set equal to pSelComp[3], with Comp being replaced by                DsY and C.            -   The arrays minGrpIdx and maxGrpIdx are derived as                follows:

minGrpIdx[0]=0  (380)

minGrpIdx[1]=2  (381)

maxGrpIdx[0]=1  (382)

maxGrpIdx[1]=3  (383)

-   -   -   -   When pSelDsY[minGrpIdx[0]] is greater than                pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are                swapped as follows:

(minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1])  (384)

-   -   -   -   When pSelDsY[maxGrpIdx[0]] is greater than                pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are                swapped as follows:

(maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1])  (385)

-   -   -   -   When pSelDsY[minGrpIdx[0]] is greater than                pSelDsY[maxGrpIdx[1]], arrays minGrpIdx and maxGrpIdx                are swapped as follows:

(minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx)  (386)

-   -   -   -   When pSelDsY[minGrpIdx[1]] is greater than                pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are                swapped as follows:

(minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0])  (387)

-   -   -   -   The variables maxY, maxC, minY and minC are derived as                follows:

maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1  (388)

maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1  (389)

minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1  (390)

minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1  (391)

-   -   -   7. The variables a, b, and k are derived as follows:            -   If numSampL is equal to 0, and numSampT is equal to 0,                the following applies:

k=0  (392)

a=0  (393)

b=1<<(BitDepth−1)  (394)

-   -   -   -   Otherwise, the following applies:

diff=maxY−minY  (395)

-   -   -   -   -   If diff is not equal to 0, the following applies:

diffC=maxC−minC  (396)

x=Floor(Log 2(diff))  (397)

normDiff=((diff<<4)>>x)&15  (398)

x+=(normDiff !=0)?1:0  (399)

y=Abs(diffC)>0?Floor(Log 2(Abs(diffC)))+1:0  (400)

a=(diffC*(divSigTable[normDiff]|8)+2^(y-1))>>y  (401)

k=((3+x−y)<1)?1:3+x−y  (402)

a=((3+x−y)<1)?Sign(a)*15:a  (403)

b=minC−((a*minY)>>k)  (404)

-   -    where divSigTable[ ] is specified as follows:

divSigTable[ ]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0}  (405)

-   -   -   -   -   Otherwise (diff is equal to 0), the following                    applies:

k=0  (406)

a=0  (407)

b=minC  (408)

-   -   -   8. The prediction samples predSamples[x][y] with x=0 . . .            nTbW−1, y=0 . . . nTbH−1 are derived as follows:

predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b)  (409)

-   -   NOTE—This process uses sps_chroma_vertical_collocated_flag.        However, in order to simplify implementation, it does not use        sps_chroma_horizontal_collocated_flag.

5.11. Embodiment 11

The working draft specified in JVET-Q2001-vE may be changed as below.8.4.5.2.13Inputs to this process are:

-   -   the intra prediction mode predModeIntra,    -   a sample location (xTbC, yTbC) of the top-left sample of the        current transform block relative to the top-left sample of the        current picture,    -   a variable nTbW specifying the transform block width,    -   a variable nTbH specifying the transform block height,    -   a variable cIdx specifying the colour component of the current        block,    -   chroma neighbouring samples p[x][y], with x=−1, y=0 . . .        2*nTbH−1 and x=0 . . . 2*nTbW−1, y=−1.        Output of this process are predicted samples predSamples[x][y],        with x=0 . . . nTbW−1, y=0 . . . nTbH−1.        The current luma location (xTbY, yTbY) is derived as follows:

(xTbY,yTbY)=(xTbC<<(SubWidthC−1),yTbC<<(SubHeightC−1))  (351)

The variables availL, availT and availTL are derived as follows:

-   -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY−1, yTbY), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availL.    -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY, yTbY−1), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availT.    -   The number of available top-right neighbouring chroma samples        numTopRight is derived as follows:        -   The variable numTopRight is set equal to 0 and availTR is            set equal to TRUE.        -   When predModeIntra is equal to INTRA_T_CCLM, the following            applies for x=nTbW . . . 2*nTbW−1 until availTR is equal to            FALSE or x is equal to 2*nTbW−1:            -   The derivation process for neighbouring block                availability as specified in clause 6.4.4 is invoked                with the current luma location (xCurr, yCurr) set equal                to (xTbY, yTbY) the neighbouring luma location (xTbY+x,                yTbY−1), checkPredModeY set equal to FALSE, and cIdx as                inputs, and the output is assigned to availTR            -   When availTR is equal to TRUE, numTopRight is                incremented by one.    -   The number of available left-below neighbouring chroma samples        numLeftBelow is derived as follows:        -   The variable numLeftBelow is set equal to 0 and availLB is            set equal to TRUE.        -   When predModeIntra is equal to INTRA_L_CCLM, the following            applies for y=nTbH . . . 2*nTbH−1 until availLB is equal to            FALSE or y is equal to 2*nTbH−1:            -   The derivation process for neighbouring block                availability as specified in clause 6.4.4 is invoked                with the current luma location (xCurr, yCurr) set equal                to (xTbY, yTbY), the neighbouring luma location (xTbY−1,                yTbY+y), checkPredModeY set equal to FALSE, and cIdx as                inputs, and the output is assigned to availLB            -   When availLB is equal to TRUE, numLeftBelow is                incremented by one.                The number of available neighbouring chroma samples on                the top and top-right numSampT and the number of                available neighbouring chroma samples on the left and                left-below numSampL are derived as follows:    -   If predModeIntra is equal to INTRA_LT_CCLM, the following        applies:

numSampT=availT?nTbW:0  (353)

numSampL=availL?nTbH:0  (354)

-   -   Otherwise, the following applies:

numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0  (355)

numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0  (356)

The variable bCTUboundary is derived as follows:

bCTUboundary=(yTbY&(CtbSizeY−1)==0)?TRUE:FALSE.  (357)

The variable cntN and array pickPosN with N being replaced by L and T,are derived as follows:

-   -   The variable numIs4N is derived as follows:

numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1)  (358)

-   -   The variable startPosN is set equal to numSampN>>(2+numIs4N).    -   The variable pickStepN is set equal to Max(1,        numSampN>>(1+numIs4N)).    -   If availN is equal to TRUE and predModeIntra is equal to        INTRA_LT_CCLM or INTRA_N_CCLM, the following assignments are        made:        -   cntN is set equal to Min(numSampN, (1+numIs4N)<<1).        -   pickPosN[pos] is set equal to (startPosN+pos*pickStepN),            with pos=0 . . . cntN−1.    -   Otherwise, cntN is set equal to 0.        The prediction samples predSamples[x][y] with x=0 . . . nTbW−1,        y=0 . . . nTbH−1 are derived as follows:    -   If both numSampL and numSampT are equal to 0, the following        applies:

predSamples[x][y]=1<<(BitDepth−1)  (359)

-   -   Otherwise, the following ordered steps apply:        -   1. The collocated luma samples pY[x][y] with x=0 . . .            nTbW*SubWidthC−1, y=0 . . . nTbH*SubHeightC−1 are set equal            to the reconstructed luma samples prior to the deblocking            filter process at the locations (xTbY+x, yTbY+y).        -   2. The neighbouring luma samples pY[x][y] are derived as            follows:            -   When numSampL is greater than 0, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=0 . . .                SubHeightC*numSampL−1, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availT is equal to FALSE, the neighbouring top luma                samples pY[x][y] with x=−1 . . . SubWidthC*numSampT−1,                y=−1 . . . -2, are set equal to the luma samples                pY[x][0].            -   When availL is equal to FALSE, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=−1 . . .                SubHeightC*numSampL−1, are set equal to the luma samples                pY[0][y].            -   When numSampT is greater than 0, the neighbouring top                luma samples pY[x][y] with x=0 . . .                SubWidthC*numSampT−1, y=−1, −2, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   ,                ,                ,                ,                ,            -   ,                ,                ,                ,                ,                ,                .        -   3. The down-sampled collocated luma samples pDsY[x][y] with            x=0 . . . nTbW−1, y=0 . . . nTbH−1 are derived as follows:            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:                -   pDsY[x][y] with x=1 . . . nTbW−1, y=1 . . . nTbH−1                    is derived as follows:

pDstY[x][y]=pY[x][y]  (360)

-   -   -   -   Otherwise, the following applies:                -   The one-dimensional filter coefficients array F1 and                    F2, and the 2-dimensional filter coefficients arrays                    F3 and F4 are specified as follows.

F1[0]=2,F1[1]=0  (361)

F2[0]=1,F2[1]=2,F2[2]=1  (362)

F3[i][j]=F4[i][j]=0,with i=0 . . . 2,j=0 . . . 2  (363)

-   -   -   -   -    If both SubWidthC and SubHeightC are equal to 2,                    the following applies:

F1[0]=1,F1[1]=1  (364)

F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1  (365)

F4[0][1]=1,F4[1][1]=2,F4[2][1]=1  (366)

F4[0][2]=1,F4[1][2]=2,F4[2][2]=1  (367)

-   -   -   -   -    Otherwise, the following applies:

F3[1][1]=8  (368)

F4[0][1]=2,F4[1][1]=4,F4[2][1]=2,  (369)

-   -   -   -   -   If sps_chromavertical_collocated_flag is equal to 1,                    the following applies:                -    pDsY[x][y] with x=0 . . . nTbW−1, y=0 . . . nTbH−1                    is derived as follows:

pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y−1]+F3[0][1]*pY[SubWidthC*x−1][SubHeightC*y]+F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3  (370)

-   -   -   -   -   Otherwise (sps_chromavertical_collocated_flag is                    equal to 0), the following applies:                -    pDsY[x][y] with x=0 . . . nTbW−1, y=0 . . . nTbH−1                    is derived as follows:

pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x−1][SubHeightC*y]+F4[0][2]*pY[SubWidthC*x−1][SubHeightC*y+1]+F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3  (371)

-   -   -   4. When numSampL is greater than 0, the selected            neighbouring left chroma samples pSelC[idx] are set equal to            p[−1][pickPosL[idx]] with idx=0 . . . cntL−1, and the            selected down-sampled neighbouring left luma samples            pSelDsY[idx] with idx=0 . . . cntL−1 are derived as follows:            -   The variable y is set equal to pickPosL[idx].            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:

pSelDsY[idx]=pY[−1][y]  (372)

-   -   -   -   Otherwise the following applies:                -   If sps_chroma_vertical_collocated_flag is equal to                    1, the following applies:

pSelDsY[idx]=(F3[1][0]*pY[−SubWidthC][SubHeightC*y−1]+F3[0][1]*pY[−1−SubWidthC][SubHeightC*y]+F3[1][1]*pY[−SubWidthC][SubHeightC*y]+F3[2][1]*pY[1−SubWidthC][SubHeightC*y]+F3[1][2]*pY[−SubWidthC][SubHeightC*y+1]+4)>>3  (373)

-   -   -   -   -   Otherwise (sps_chroma_vertical_collocated_flag is                    equal to 0), the following applies:

pSelDsY[idx]=(F4[0][1]*pY[−1−SubWidthC][SubHeightC*y]+F4[0][2]*pY[−1−SubWidthC][SubHeightC*y]+1+F4[1][1]*pY[−SubWidthC][SubHeightC*y]+F4[1][2]*pY[−SubWidthC][SubHeightC*y+1]+F4[2][1]*pY[1−SubWidthC][SubHeightC*y]+F4[2][2]*pY[1−SubWidthC][SubHeightC*y+1]+4)>>3  (374)

-   -   -   5. When numSampT is greater than 0, the selected            neighbouring top chroma samples pSelC[idx] are set equal to            p[pickPosT[idx−cntL]][−1] with idx=cntL . . . cntL+cntT−1,            and the down-sampled neighbouring top luma samples            pSelDsY[idx] with idx=0 . . . cntL+cntT−1 are specified as            follows:            -   The variable x is set equal to pickPosT[idx−cntL].            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:

pSelDsY[idx]=pY[x][−1]  (375)

-   -   -   -   Otherwise, the following applies:                -   If sps_chroma_vertical_collocated_flag is equal to                    1, the following applies:                -    If bCTUboundary is equal to FALSE, the following                    applies:

pSelDsY[idx]=(F3[1][0]*pY[SubWidthC*x][−1−SubHeightC]+F3[0][1]*pY[SubWidthC*x−1][−SubHeightC]+F3[1][1]*pY[SubWidthC*x][−SubHeightC]+F3[2][1]*pY[SubWidthC*x+1][−SubHeightC]+F3[1][2]*pY[SubWidthC*x][1−SubHeightC]+4)>>3  (376)

-   -   -   -   Otherwise (bCTUboundary is equal to TRUE), the following                applies:

pSelDsY[idx]=(F2[0]*pY[SubWidthC*x−1][−1]+F2[1]*pY[SubWidthC*x][−1]+F2[2]*pY[SubWidthC*x+1][−1]+2)>>2  (377)

-   -   -   -   Otherwise (sps_chroma_vertical_collocated_flag is equal                to 0), the following applies:                -   If bCTUboundary is equal to FALSE, the following                    applies:

pSelDsY[idx]=(F4[0][1]*pY[SubWidthCx−1][−1]+F4[0][2]*pY[SubWidthC*x−1][−2]+F4[1][1]*pY[SubWidthC*x][−1]+F4[1][2]*pY[SubWidthC*x][−2]+F4[2][1]*pY[SubWidthC*x+1][−1]+F4[2][2]*pY[SubWidthC*x+1][−2]+4)>>3  (378)

-   -   -   -   -   Otherwise (bCTUboundary is equal to TRUE), the                    following applies:

pSelDsY[idx]=(F2[0]*pY[SubWidthC*x−1][−1]+F2[1]*pY[SubWidthC*x][−1]+F2[2]*pY[SubWidthC*x+1][−1]+2)>>2  (379)

-   -   -   6. When cntT+cntL is not equal to 0, the variables minY,            maxY, minC and maxC are derived as follows:            -   When cntT+cntL is equal to 2, pSelComp[3] is set equal                to pSelComp[0], pSelComp[2] is set equal to pSelComp[1],                pSelComp[0] is set equal to pSelComp[1], and pSelComp[1]                is set equal to pSelComp[3], with Comp being replaced by                DsY and C.            -   The arrays minGrpIdx and maxGrpIdx are derived as                follows:

minGrpIdx[0]=0  (380)

minGrpIdx[1]=2  (381)

maxGrpIdx[0]=1  (382)

maxGrpIdx[1]=3  (383)

-   -   -   -   When pSelDsY[minGrpIdx[0]] is greater than                pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are                swapped as follows:

(minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1])  (384)

-   -   -   -   When pSelDsY[maxGrpIdx[0]] is greater than                pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are                swapped as follows:

(maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1])  (385)

-   -   -   -   When pSelDsY[minGrpIdx[0]] is greater than                pSelDsY[maxGrpIdx[1]], arrays minGrpIdx and maxGrpIdx                are swapped as follows:

(minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx)  (386)

-   -   -   -   When pSelDsY[minGrpIdx[1]] is greater than                pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are                swapped as follows:

(minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0])  (387)

-   -   -   -   The variables maxY, maxC, minY and minC are derived as                follows:

maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1  (388)

maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1  (389)

minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1  (390)

minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1  (391)

-   -   -   7. The variables a, b, and k are derived as follows:            -   If numSampL is equal to 0, and numSampT is equal to 0,                the following applies:

k=0  (392)

a=0  (393)

b=1<<(BitDepth−1)  (394)

-   -   -   -   Otherwise, the following applies:

diff=maxY−minY  (395)

-   -   -   -   -   If diff is not equal to 0, the following applies:

diffC=maxC−minC  (396)

x=Floor(Log 2(diff))  (397)

normDiff=((diff<<4)>>x)&15  (398)

x+=(normDiff !=0)?1:0  (399)

y=Abs(diffC)>0?Floor(Log 2(Abs(diffC)))+1:0  (400)

a=(diffC*(divSigTable[normDiff]|8)+2^(y-1))>>y  (401)

k=((3+x−y)<1)?1:3+x−y  (402)

a=((3+x−y)<1)?Sign(a)*15:a  (403)

b=minC−((a*minY)>>k)  (404)

-   -   -   -   -    where divSigTable[ ] is specified as follows:

divSigTable[ ]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0}  (405)

-   -   -   -   -   Otherwise (diff is equal to 0), the following                    applies:

k=0  (406)

a=0  (407)

b=minC  (408)

-   -   -   8. The prediction samples predSamples[x][y] with x=0 . . .            nTbW−1, y=0 . . . nTbH−1 are derived as follows:

predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b)  (409)

-   -   NOTE—This process uses sps_chroma_vertical_collocated_flag.        However, in order to simplify implementation, it does not use        sps_chroma_horizontal_collocated_flag.

5.12. Embodiment 12

The working draft specified in JVET-Q2001-vE may be changed as below.8.4.5.2.13Inputs to this process are:

-   -   the intra prediction mode predModeIntra,    -   a sample location (xTbC, yTbC) of the top-left sample of the        current transform block relative to the top-left sample of the        current picture,    -   a variable nTbW specifying the transform block width,    -   a variable nTbH specifying the transform block height,    -   a variable cIdx specifying the colour component of the current        block,    -   chroma neighbouring samples p[x][y], with x=−1, y=0 . . .        2*nTbH−1 and x=0 . . . 2*nTbW−1, y=−1.        Output of this process are predicted samples predSamples[x][y],        with x=0 . . . nTbW−1, y=0 . . . nTbH−1.        The current luma location (xTbY, yTbY) is derived as follows:

(xTbY,yTbY)=(xTbC<<(SubWidthC−1),yTbC<<(SubHeightC−1))  (351)

The variables availL, availT and availTL are derived as follows:

-   -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY−1, yTbY), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availL.    -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY, yTbY−1), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availT.    -   The variable availTL is derived as follows:

availTL=availL&&availT  (352)

-   -   The number of available top-right neighbouring chroma samples        numTopRight is derived as follows:        -   The variable numTopRight is set equal to 0 and availTR is            set equal to TRUE.        -   When predModeIntra is equal to INTRA_T_CCLM, the following            applies for x=nTbW . . . 2*nTbW−1 until availTR is equal to            FALSE or x is equal to 2*nTbW−1:            -   The derivation process for neighbouring block                availability as specified in clause 6.4.4 is invoked                with the current luma location (xCurr, yCurr) set equal                to (xTbY, yTbY) the neighbouring luma location (xTbY+x,                yTbY−1), checkPredModeY set equal to FALSE, and cIdx as                inputs, and the output is assigned to availTR            -   When availTR is equal to TRUE, numTopRight is                incremented by one.    -   The number of available left-below neighbouring chroma samples        numLeftBelow is derived as follows:        -   The variable numLeftBelow is set equal to 0 and availLB is            set equal to TRUE.        -   When predModeIntra is equal to INTRA_L_CCLM, the following            applies for y=nTbH . . . 2*nTbH−1 until availLB is equal to            FALSE or y is equal to 2*nTbH−1:            -   The derivation process for neighbouring block                availability as specified in clause 6.4.4 is invoked                with the current luma location (xCurr, yCurr) set equal                to (xTbY, yTbY), the neighbouring luma location (xTbY−1,                yTbY+y), checkPredModeY set equal to FALSE, and cIdx as                inputs, and the output is assigned to availLB            -   When availLB is equal to TRUE, numLeftBelow is                incremented by one.                The number of available neighbouring chroma samples on                the top and top-right numSampT and the number of                available neighbouring chroma samples on the left and                left-below numSampL are derived as follows:    -   If predModeIntra is equal to INTRA_LT_CCLM, the following        applies:

numSampT=availT?nTbW:0  (353)

numSampL=availL?nTbH:0  (354)

-   -   Otherwise, the following applies:

numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0  (355)

numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0  (356)

The variable bCTUboundary is derived as follows:

bCTUboundary=(yTbY&(CtbSizeY−1)==0)?TRUE:FALSE.  (357)

The variable cntN and array pickPosN with N being replaced by L and T,are derived as follows:

-   -   The variable numIs4N is derived as follows:

numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1)  (358)

-   -   The variable startPosN is set equal to numSampN>>(2+numIs4N).    -   The variable pickStepN is set equal to Max(1,        numSampN>>(1+numIs4N)).    -   If availN is equal to TRUE and predModeIntra is equal to        INTRA_LT_CCLM or INTRA_N_CCLM, the following assignments are        made:        -   cntN is set equal to Min(numSampN, (1+numIs4N)<<1).        -   pickPosN[pos] is set equal to (startPosN+pos*pickStepN),            with pos=0 . . . cntN−1.    -   Otherwise, cntN is set equal to 0.        The prediction samples predSamples[x][y] with x=0 . . . nTbW−1,        y=0 . . . nTbH−1 are derived as follows:    -   If both numSampL and numSampT are equal to 0, the following        applies:

predSamples[x][y]=1<<(BitDepth−1)  (359)

-   -   Otherwise, the following ordered steps apply:        -   1. The collocated luma samples pY[x][y] with x=0 . . .            nTbW*SubWidthC−1, y=0 . . . nTbH*SubHeightC−1 are set equal            to the reconstructed luma samples prior to the deblocking            filter process at the locations (xTbY+x, yTbY+y).        -   2. The neighbouring luma samples pY[x][y] are derived as            follows:            -   When numSampL is greater than 0, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=0 . . .                SubHeightC*numSampL−1, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availT is equal to FALSE, the neighbouring top luma                samples pY[x][y] with x=−1 . . . SubWidthC*numSampT−1,                y=−1 . . . −2, are set equal to the luma samples                pY[x][0].            -   When availL is equal to FALSE, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=−1 . . .                SubHeightC*numSampL−1, are set equal to the luma samples                pY[0][y].            -   When numSampT is greater than 0, the neighbouring top                luma samples pY[x][y] with x=0 . . .                SubWidthC*numSampT−1, y=−1, −23 are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availTL is equal to TRUE, the neighbouring top-left                luma samples pY[x][y] with x=−1, −2, y=−1, −2 are set                equal to the reconstructed luma samples prior to the                deblocking filter process at the locations (xTbY+x,                yTbY+y).        -   3. The down-sampled collocated luma samples pDsY[x][y] with            x=0 . . . nTbW−1, y=0 . . . nTbH−1 are derived as follows:            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:                -   pDsY[x][y] with x=1 . . . nTbW−1, y=1 . . . nTbH−1                    is derived as follows:

pDstY[x][y]=pY[x][y]  (360)

-   -   -   -   Otherwise, the following applies:                -   The one-dimensional filter coefficients array F1 and                    F2, and the 2-dimensional filter coefficients arrays                    F3 and F4 are specified as follows.

F1[0]=2,F1[1]=0  (361)

F2[0]=1,F2[1]=2,F2[2]=1  (362)

F3[i][j]=F4[i][j]=0,with i=0 . . . 2,j=0 . . . 2  (363)

-   -   -   -   -    If both SubWidthC and SubHeightC are equal to 2,                    the following applies:

F1[0]=1,F1[1]=1  (364)

F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1  (365)

F4[0][1]=1,F4[1][1]=2,F4[2][1]=1  (366)

F4[0][2]=1,F4[1][2]=2,F4[2][2]=1  (367)

-   -   -   -   -    Otherwise, the following applies:

F3[1][1]=8  (368)

F4[0][1]=2,F4[1][1]=4,F4[2][1]=2,  (369)

-   -   -   -   -   If sps_chromavertical_collocated_flag is equal to 1,                    the following applies:                -    pDsY[x][y] with x=0 . . . nTbW−1, y=0 . . . nTbH−1                    is derived as follows:

pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y−1]+F3[0][1]*pY[SubWidthC*x−1][SubHeightC*y]+F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3  (370)

-   -   -   -   Otherwise (sps_chroma_vertical_collocated_flag is equal                to 0), the following applies:                -   pDsY[x][y] with x=0 . . . nTbW−1, y=0 . . . nTbH−1                    is derived as follows:

pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x−1][SubHeightC*y]+F4[0][2]*pY[SubWidthC*x−1][SubHeightC*y+1]+F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3  (371)

-   -   -   4. When numSampL is greater than 0, the selected            neighbouring left chroma samples pSelC[idx] are set equal to            p[−1][pickPosL[idx]] with idx=0 . . . cntL−1, and the            selected down-sampled neighbouring left luma samples            pSelDsY[idx] with idx=0 . . . cntL−1 are derived as follows:            -   The variable y is set equal to pickPosL[idx].            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:

pSelDsY[idx]=pY[−1][y]  (372)

-   -   -   -   Otherwise the following applies:                -   If sps_chroma_vertical_collocated_flag is equal to                    1, the following applies:

pSelDsY[idx]=(F3[1][0]*pY[−SubWidthC][SubHeightC*y−1]+F3[0][1]*pY[−1−SubWidthC][SubHeightC*y]+F3[1][1]*pY[−SubWidthC][SubHeightC*y]+F3[2][1]*pY[1−SubWidthC][SubHeightC*y]+F3[1][2]*pY[−SubWidthC][SubHeightC*y+1]+4)>>3  (373)

-   -   -   -   -   Otherwise (sps_chroma_vertical_collocated_flag is                    equal to 0), the following applies:

pSelDsY[idx]=(F4[0][1]*pY[−1−SubWidthC][SubHeightC*y]+F4[0][2]*pY[−1−SubWidthC][SubHeightC*y]+1+F4[1][1]*pY[−SubWidthC][SubHeightC*y]+F4[1][2]*pY[−SubWidthC][SubHeightC*y+1]+F4[2][1]*pY[1−SubWidthC][SubHeightC*y]+F4[2][2]*pY[1−SubWidthC][SubHeightC*y+1]+4)>>3  (374)

-   -   -   5. When numSampT is greater than 0, the selected            neighbouring top chroma samples pSelC[idx] are set equal to            p[pickPosT[idx−cntL]][−1] with idx=cntL . . . cntL+cntT−1,            and the down-sampled neighbouring top luma samples            pSelDsY[idx] with idx=0 . . . cntL+cntT−1 are specified as            follows:            -   The variable x is set equal to pickPosT[idx−cntL].            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:

pSelDsY[idx]=pY[x][−1]  (375)

-   -   -   -   Otherwise, the following applies:                -   If sps_chroma_vertical_collocated_flag is equal to                    1, the following applies:                -    If bCTUboundary is equal to FALSE, the following                    applies:

pSelDsY[idx]=(F3[1][0]*pY[SubWidthC*x][−1−SubHeightC]+F3[0][1]*pY[SubWidthC*x−1][−SubHeightC]+F3[1][1]*pY[SubWidthC*x][−SubHeightC]+F3[2][1]*pY[SubWidthC*x+1][−SubHeightC]+F3[1][2]*pY[SubWidthC*x][1−SubHeightC]+4)>>3  (376)

-   -   -   -   -    Otherwise (bCTUboundary is equal to TRUE), the                    following applies:

pSelDsY[idx]=(F2[0]*pY[SubWidthC*x−1][−1]+F2[1]*pY[SubWidthC*x][−1]+F2[2]*pY[SubWidthC*x+1][−1]+2)>>2  (377)

-   -   -   -   -   Otherwise (sps_chroma_vertical_collocated_flag is                    equal to 0), the following applies:                -    If bCTUboundary is equal to FALSE, the following                    applies:

pSelDsY[idx]=(F4[0][1]*pY[SubWidthCx−1][−1]+F4[0][2]*pY[SubWidthC*x−1][−2]+F4[1][1]*pY[SubWidthC*x][−1]+F4[1][2]*pY[SubWidthC*x][−2]+F4[2][1]*pY[SubWidthC*x+1][−1]+F4[2][2]*pY[SubWidthC*x+1][−2]+4)>>3  (378)

-   -   -   -   -    Otherwise (bCTUboundary is equal to TRUE), the                    following applies:

pSelDsY[idx]=(F2[0]*pY[SubWidthC*x−1][−1]+F2[1]*pY[SubWidthC*x][−1]+F2[2]*pY[SubWidthC*x+1][−1]+2)>>2  (379)

-   -   -   6. When cntT+cntL is not equal to 0, the variables minY,            maxY, minC and maxC are derived as follows:            -   When cntT+cntL is equal to 2, pSelComp[3] is set equal                to pSelComp[0], pSelComp[2] is set equal to pSelComp[1],                pSelComp[0] is set equal to pSelComp[1], and pSelComp[1]                is set equal to pSelComp[3], with Comp being replaced by                DsY and C.            -   The arrays minGrpIdx and maxGrpIdx are derived as                follows:

minGrpIdx[0]=0  (380)

minGrpIdx[1]=2  (381)

maxGrpIdx[0]=1  (382)

maxGrpIdx[1]=3  (383)

-   -   -   -   When pSelDsY[minGrpIdx[0]] is greater than                pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are                swapped as follows:

(minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1])  (384)

-   -   -   -   When pSelDsY[maxGrpIdx[0]] is greater than                pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are                swapped as follows:

(maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1])  (385)

-   -   -   -   When pSelDsY[minGrpIdx[0]] is greater than                pSelDsY[maxGrpIdx[1]], arrays minGrpIdx and maxGrpIdx                are swapped as follows:

(minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx)  (386)

-   -   -   -   When pSelDsY[minGrpIdx[1]] is greater than                pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are                swapped as follows:

(minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0])  (387)

-   -   -   -   The variables maxY, maxC, minY and minC are derived as                follows:

maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1  (388)

maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1  (389)

minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1  (390)

minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1  (391)

-   -   -   7. The variables a, b, and k are derived as follows:            -   If numSampL is equal to 0, and numSampT is equal to 0,                the following applies:

k=0  (392)

a=0  (393)

b=1<<(BitDepth−1)  (394)

-   -   -   -   Otherwise, the following applies:

diff=maxY−minY  (395)

-   -   -   -   -   If diff is not equal to 0, the following applies:

diffC=maxC−minC  (396)

x=Floor(Log 2(diff))  (397)

normDiff=((diff<<4)>>x)&15  (398)

x+=(normDiff !=0)?1:0  (399)

y=Abs(diffC)>0?Floor(Log 2(Abs(diffC)))+1:0  (400)

a=(diffC*(divSigTable[normDiff]|8)+2^(y-1))>>y  (401)

k=((3+x−y)<1)?1:3+x−y  (402)

a=((3+x−y)<1)?Sign(a)*15:a  (403)

b=minC−((a*minY)>>k)  (404)

-   -   -   -   -    where divSigTable[ ] is specified as follows:

divSigTable[ ]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0}  (405)

-   -   -   -   -   Otherwise (diff is equal to 0), the following                    applies:

k=0  (406)

a=0  (407)

b=minC  (408)

-   -   -   8. The prediction samples predSamples[x][y] with x=0 . . .            nTbW−1, y=0 . . . nTbH−1 are derived as follows:

predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b)  (409)

-   -   NOTE—This process uses sps_chroma_vertical_collocated_flag.        However, in order to simplify implementation, it does not use        sps_chroma_horizontal_collocated_flag.

5.13. Embodiment 13

The working draft specified in JVET-Q2001-vE may be changed as below.

8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLMIntra Prediction Mode

The prediction samples predSamples[x][y] with x=0 . . . nTbW−1, y=0 . .. nTbH−1 are derived as follows:

-   -   If both numSampL and numSampT are equal to 0, the following        applies:

predSamples[x][y]=1<<(BitDepth−1)  (359)

-   -   Otherwise, the following ordered steps apply:        -   1. The collocated luma samples pY[x][y] with x=0 . . .            nTbW*SubWidthC−1, y=0 . . . nTbH*SubHeightC−1 are set equal            to the reconstructed luma samples prior to the deblocking            filter process at the locations (xTbY+x, yTbY+y).        -   2. The neighbouring luma samples pY[x][y] are derived as            follows:            -   When numSampL is greater than 0, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=0 . . .                SubHeightC*numSampL−1, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availT is equal to FALSE, the neighbouring top luma                samples pY[x][y] with x=−                . . . SubWidthC*                −1, y=−1 . . . −2, are set equal to the luma samples                pY[x][0].            -   When availL is equal to FALSE, the neighbouring left                luma samples pY[x][y] with x=−1 . . . -3, y=−1 . . .                SubHeightC*numSampL−1, are set equal to the luma samples                pY[0][y].            -   When numSampT is greater than 0, the neighbouring top                luma samples pY[x][y] with x=0 . . .                SubWidthC*numSampT−1, y=−1, −2, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availTL is equal to TRUE, the neighbouring top-left                luma samples pY[x][y] with x=−1, y=−1, −2 are set equal                to the reconstructed luma samples prior to the                deblocking filter process at the locations (xTbY+x,                yTbY+y).

5.14. Embodiment 14

The working draft specified in JVET-Q2001-vE may be changed as below.

8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLMIntra Prediction Mode

The prediction samples predSamples[x][y] with x=0 . . . nTbW−1, y=0 . .. nTbH−1 are derived as follows:

-   -   If both numSampL and numSampT are equal to 0, the following        applies:

predSamples[x][y]=1<<(BitDepth−1)  (359)

-   -   Otherwise, the following ordered steps apply:        -   1. The collocated luma samples pY[x][y] with x=0 . . .            nTbW*SubWidthC−1, y=0 . . . nTbH*SubHeightC−1 are set equal            to the reconstructed luma samples prior to the deblocking            filter process at the locations (xTbY+x, yTbY+y).        -   2. The neighbouring luma samples pY[x][y] are derived as            follows:            -   When numSampL is greater than 0, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=0 . . .                SubHeightC*numSampL−1, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availT is equal to FALSE                , the neighbouring top luma samples pY[x][y] with x=−                . . . SubWidthC*                −1, y=−1 . . . −2, are set equal to the luma samples                pY[x][0].            -   When availL is equal to FALSE, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=−1 . . .                SubHeightC*numSampL−1, are set equal to the luma samples                pY[0][y].            -   When numSampT is greater than 0, the neighbouring top                luma samples pY[x][y] with x=0 . . .                SubWidthC*numSampT−1, y=−1, −2, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availTL is equal to TRUE, the neighbouring top-left                luma samples pY[x][y] with x=−1, y=−1, −2 are set equal                to the reconstructed luma samples prior to the                deblocking filter process at the locations (xTbY+x,                yTbY+y).

5.15. Embodiment 15

The working draft specified in JVET-Q2001-vE may be changed as below.

8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLMIntra Prediction Mode

The prediction samples predSamples[x][y] with x=0 . . . nTbW−1, y=0 . .. nTbH−1 are derived as follows:

-   -   If both numSampL and numSampT are equal to 0, the following        applies:

predSamples[x][y]=1<<(BitDepth−1)  (359)

-   -   Otherwise, the following ordered steps apply:        -   1. The collocated luma samples pY[x][y] with x=0 . . .            nTbW*SubWidthC−1, y=0 . . . nTbH*SubHeightC−1 are set equal            to the reconstructed luma samples prior to the deblocking            filter process at the locations (xTbY+x, yTbY+y).        -   2. The neighbouring luma samples pY[x][y] are derived as            follows:            -   When numSampL is greater than 0, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=0 . . .                SubHeightC*numSampL−1, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availT is equal to FALSE, the neighbouring top luma                samples pY[x][y] with x=−1 . . . SubWidthC*numSampT−1,                y=−1 . . . −2, are set equal to the luma samples                pY[x][0].            -   When availL is equal to FALSE, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=−                . . . SubHeightC*                −1, are set equal to the luma samples pY[0][y].            -   When numSampT is greater than 0, the neighbouring top                luma samples pY[x][y] with x=0 . . .                SubWidthC*numSampT−1, y=−1, −2, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availTL is equal to TRUE, the neighbouring top-left                luma samples pY[x][y] with x=−1, y=−1, −2 are set equal                to the reconstructed luma samples prior to the                deblocking filter process at the locations (xTbY+x,                yTbY+y).

5.16. Embodiment 16

The working draft specified in JVET-Q2001-vE may be changed as below.

8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLMIntra Prediction Mode

The prediction samples predSamples[x][y] with x=0 . . . nTbW−1, y=0 . .. nTbH−1 are derived as follows:

-   -   If both numSampL and numSampT are equal to 0, the following        applies:

predSamples[x][y]=1<<(BitDepth−1)  (359)

-   -   Otherwise, the following ordered steps apply:        -   1. The collocated luma samples pY[x][y] with x=0 . . .            nTbW*SubWidthC−1, y=0 . . . nTbH*SubHeightC−1 are set equal            to the reconstructed luma samples prior to the deblocking            filter process at the locations (xTbY+x, yTbY+y).        -   2. The neighbouring luma samples pY[x][y] are derived as            follows:            -   When numSampL is greater than 0, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=0 . . .                SubHeightC*numSampL−1, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availT is equal to FALSE, the neighbouring top luma                samples pY[x][y] with x=−1 . . . SubWidthC*numSampT−1,                y=−1 . . . −2, are set equal to the luma samples                pY[x][0].            -   When numSampT is greater than 0, the neighbouring top                luma samples pY[x][y] with x=0 . . .                SubWidthC*numSampT−1, y=−1, −2, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   ,                ,                ,                .            -   When availTL is equal to TRUE, the neighbouring top-left                luma samples pY[x][y] with x=−1, y=−1, −2 are set equal                to the reconstructed luma samples prior to the                deblocking filter process at the locations (xTbY+x,                yTbY+y).

5.17. Embodiment 17

The working draft specified in JVET-Q2001-vE may be changed as below.

8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLMIntra Prediction Mode

Inputs to this process are:

-   -   the intra prediction mode predModeIntra,    -   a sample location (xTbC, yTbC) of the top-left sample of the        current transform block relative to the top-left sample of the        current picture,    -   a variable nTbW specifying the transform block width,    -   a variable nTbH specifying the transform block height,    -   a variable cIdx specifying the colour component of the current        block,    -   chroma neighbouring samples p[x][y], with x=−1, y=0 . . .        2*nTbH−1 and x=0 . . . 2*nTbW−1, y=−1.        Output of this process are predicted samples predSamples[x][y],        with x=0 . . . nTbW−1, y=0 . . . nTbH−1.        The current luma location (xTbY, yTbY) is derived as follows:

(xTbY,yTbY)=(xTbC<<(SubWidthC−1),yTbC<<(SubHeightC−1))  (351)

The variables availL, availT and availTL are derived as follows:

-   -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY−1, yTbY), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availL.    -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY, yTbY−1), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availT.    -   ,        -   ,            ,            ,            ,            ,            ,            ,            .    -   ,        .

5.18. Embodiment 18

The working draft specified in JVET-Q2001-vE may be changed as below.

8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLMIntra Prediction Mode

The prediction samples predSamples[x][y] with x=0 . . . nTbW−1, y=0 . .. nTbH−1 are derived as follows:

-   -   If both numSampL and numSampT are equal to 0, the following        applies:

predSamples[x][y]=1<<(BitDepth−1)  (359)

-   -   Otherwise, the following ordered steps apply:        -   1. The collocated luma samples pY[x][y] with x=0 . . .            nTbW*SubWidthC−1, y=0 . . . nTbH*SubHeightC−1 are set equal            to the reconstructed luma samples prior to the deblocking            filter process at the locations (xTbY+x, yTbY+y).        -   2. The neighbouring luma samples pY[x][y] are derived as            follows:            -   When numSampL is greater than 0, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=0 . . .                SubHeightC*numSampL−1, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availT is equal to FALSE, the neighbouring top luma                samples pY[x][y] with x=−1 . . . SubWidthC*numSampT−1,                y=−1 . . . −2, are set equal to the luma samples                pY[x][0].            -   When availL is equal to FALSE, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=−1 . . .                SubHeightC*numSampL−1, are set equal to the luma samples                pY[0][y].            -   When numSampT is greater than 0, the neighbouring top                luma samples pY[x][y] with x=0 . . .                SubWidthC*numSampT−1, y=−1, −2, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   ,                -   ,                    ,                    ,                    ,                    ,                    .                -   ,                    ,                    ,                    ,                    ,                    .

5.19. Embodiment 19

The working draft specified in JVET-Q2001-vE may be changed as below.

8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLMIntra Prediction Mode

The prediction samples predSamples[x][y] with x=0 . . . nTbW−1, y=0 . .. nTbH−1 are derived as follows:

-   -   If both numSampL and numSampT are equal to 0, the following        applies:

predSamples[x][y]=1<<(BitDepth−1)  (359)

-   -   Otherwise, the following ordered steps apply:        -   1. The collocated luma samples pY[x][y] with x=0 . . .            nTbW*SubWidthC−1, y=0 . . . nTbH*SubHeightC−1 are set equal            to the reconstructed luma samples prior to the deblocking            filter process at the locations (xTbY+x, yTbY+y).        -   2. The neighbouring luma samples pY[x][y] are derived as            follows:            -   When numSampL is greater than 0, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=0 . . .                SubHeightC*numSampL−1, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availT is equal to FALSE, the neighbouring top luma                samples pY[x][y] with x=−1 . . . SubWidthC*numSampT−1,                y=−1 . . . −2, are set equal to the luma samples                pY[x][0].            -   When availL is equal to FALSE, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=−1 . . .                SubHeightC*numSampL−1, are set equal to the luma samples                pY[0][y].            -   When numSampT is greater than 0, the neighbouring top                luma samples pY[x][y] with x=0 . . .                SubWidthC*numSampT−1, y=−1, −2, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   ,                -   ,                    ,                    ,                    ,                    ,                    .                -   ,                    ,                    ,                    ,                    ,                    .

5.20. Embodiment 20

The working draft specified in JVET-Q2001-vE may be changed as below.

8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLMIntra Prediction Mode

Inputs to this process are:

-   -   the intra prediction mode predModeIntra,    -   a sample location (xTbC, yTbC) of the top-left sample of the        current transform block relative to the top-left sample of the        current picture,    -   a variable nTbW specifying the transform block width,    -   a variable nTbH specifying the transform block height,    -   a variable cIdx specifying the colour component of the current        block,    -   chroma neighbouring samples p[x][y], with x=−1, y=0 . . .        2*nTbH−1 and x=0 . . . 2*nTbW−1, y=−1.        Output of this process are predicted samples predSamples[x][y],        with x=0 . . . nTbW−1, y=0 . . . nTbH−1.        The current luma location (xTbY, yTbY) is derived as follows:

(xTbY,yTbY)=(xTbC<<(SubWidthC−1),yTbC<<(SubHeightC−1))  (351)

The variables availL, availT and availTL are derived as follows:

-   -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY−1, yTbY), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availL.    -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY, yTbY−1), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availT.    -   ,        -   ,            ,            ,            ,            ,            ,            .    -   ,        .        . . .        The prediction samples predSamples[x][y] with x=0 . . . nTbW−1,        y=0 . . . nTbH−1 are derived as follows:    -   If both numSampL and numSampT are equal to 0, the following        applies:

predSamples[x][y]=1<<(BitDepth−1)  (359)

-   -   Otherwise, the following ordered steps apply:        -   1. The collocated luma samples pY[x][y] with x=0 . . .            nTbW*SubWidthC−1, y=0 . . . nTbH*SubHeightC−1 are set equal            to the reconstructed luma samples prior to the deblocking            filter process at the locations (xTbY+x, yTbY+y).        -   2. The neighbouring luma samples pY[x][y] are derived as            follows:            -   When numSampL is greater than 0, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=0 . . .                SubHeightC*numSampL−1, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availT is equal to FALSE, the neighbouring top luma                samples pY[x][y] with x=−1 . . . SubWidthC*numSampT−1,                y=−1 . . . −2, are set equal to the luma samples                pY[x][0].            -   When availL is equal to FALSE, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=−1 . . .                SubHeightC*numSampL−1, are set equal to the luma samples                pY[0][y].            -   When numSampT is greater than 0, the neighbouring top                luma samples pY[x][y] with x=0 . . .                SubWidthC*numSampT−1, y=−1, −2, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availTL is equal to TRUE                , the neighbouring top-left luma samples pY[x][y] with                x=−1, y=−1, −2 are set equal to the reconstructed luma                samples prior to the deblocking filter process at the                locations (xTbY+x, yTbY+y).

5.21. Embodiment 21

The working draft specified in JVET-Q2001-vE may be changed as below.

8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLMIntra Prediction Mode

The prediction samples predSamples[x][y] with x=0 . . . nTbW−1, y=0 . .. nTbH−1 are derived as follows:

-   -   If both numSampL and numSampT are equal to 0, the following        applies:

predSamples[x][y]=1<<(BitDepth−1)  (359)

-   -   Otherwise, the following ordered steps apply:        -   1. The collocated luma samples pY[x][y] with x=0 . . .            nTbW*SubWidthC−1, y=0 . . . nTbH*SubHeightC−1 are set equal            to the reconstructed luma samples prior to the deblocking            filter process at the locations (xTbY+x, yTbY+y).        -   2. The neighbouring luma samples pY[x][y] are derived as            follows:            -   When numSampL is greater than 0, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=0 . . .                SubHeightC*numSampL−1, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availT is equal to FALSE                , the neighbouring top luma samples pY[x][y] with x=−1 .                . . SubWidthC*numSampT−1, y=−1 . . . −2, are set equal                to the luma samples pY[x][0].            -   When availL is equal to FALSE                , the neighbouring left luma samples pY[x][y] with x=−1                . . . −3, y=−1 . . . SubHeightC*numSampL−1, are set                equal to the luma samples pY[0][y].            -   When numSampT is greater than 0, the neighbouring top                luma samples pY[x][y] with x=0 . . .                SubWidthC*numSampT−1, y=−1, −2, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availTL is equal to TRUE, the neighbouring top-left                luma samples pY[x][y] with x=−1, y=−1, −2 are set equal                to the reconstructed luma samples prior to the                deblocking filter process at the locations (xTbY+x,                yTbY+y).

5.22. Embodiment 22

The working draft specified in JVET-Q2001-vE may be changed as below.

8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLMIntra Prediction Mode

The prediction samples predSamples[x][y] with x=0 . . . nTbW−1, y=0 . .. nTbH−1 are derived as follows:

-   -   If both numSampL and numSampT are equal to 0, the following        applies:

predSamples[x][y]=1<<(BitDepth−1)  (359)

-   -   Otherwise, the following ordered steps apply:        -   1. The collocated luma samples pY[x][y] with x=0 . . .            nTbW*SubWidthC−1, y=0 . . . nTbH*SubHeightC−1 are set equal            to the reconstructed luma samples prior to the deblocking            filter process at the locations (xTbY+x, yTbY+y).        -   2. The neighbouring luma samples pY[x][y] are derived as            follows:            -   When numSampL is greater than 0, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=0 . . .                SubHeightC*numSampL−1, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availT is equal to FALSE, the neighbouring top luma                samples pY[x][y] with x=0 . . . SubWidthC*numSampT−1,                y=−1 . . . -2, are set equal to the luma samples                pY[x][0].            -   When availL is equal to FALSE, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=0 . . .                SubHeightC*numSampL−1, are set equal to the luma samples                pY[0][y].            -   When numSampT is greater than 0, the neighbouring top                luma samples pY[x][y] with x=0 . . .                SubWidthC*numSampT−1, y=−1, −2, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availTL is equal to TRUE, the neighbouring top-left                luma samples pY[x][y] with x=−1, y=−1, −2 are set equal                to the reconstructed luma samples prior to the                deblocking filter process at the locations (xTbY+x,                yTbY+y).            -   ,                ,                ,                ,                ,                .            -   ,                ,                ,                ,                ,                ,                .

5.23. Embodiment 23

The working draft specified in JVET-Q2001-vE may be changed as below.

8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLMIntra Prediction Mode

Inputs to this process are:

-   -   the intra prediction mode predModeIntra,    -   a sample location (xTbC, yTbC) of the top-left sample of the        current transform block relative to the top-left sample of the        current picture,    -   a variable nTbW specifying the transform block width,    -   a variable nTbH specifying the transform block height,    -   a variable cIdx specifying the colour component of the current        block,    -   chroma neighbouring samples p[x][y], with x=−1, y=0 . . .        2*nTbH−1 and x=0 . . . 2*nTbW−1, y=−1.        Output of this process are predicted samples predSamples[x][y],        with x=0 . . . nTbW−1, y=0 . . . nTbH−1.        The current luma location (xTbY, yTbY) is derived as follows:

(xTbY,yTbY)=(xTbC<<(SubWidthC−1),yTbC<<(SubHeightC−1))  (351)

The variables availL, availT and availTL are derived as follows:

-   -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY−1, yTbY), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availL.    -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY, yTbY−1), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availT.    -   ,        -   ,            ,            ,            ,            ,            ,            ,            .    -   ,        .        . . .        The prediction samples predSamples[x][y] with x=0 . . . nTbW−1,        y=0 . . . nTbH−1 are derived as follows:    -   If both numSampL and numSampT are equal to 0, the following        applies:

predSamples[x][y]=1<<(BitDepth−1)  (359)

-   -   Otherwise, the following ordered steps apply:        -   1. The collocated luma samples pY[x][y] with x=0 . . .            nTbW*SubWidthC−1, y=0 . . . nTbH*SubHeightC−1 are set equal            to the reconstructed luma samples prior to the deblocking            filter process at the locations (xTbY+x, yTbY+y).        -   2. The neighbouring luma samples pY[x][y] are derived as            follows:            -   When numSampL is greater than 0, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=0 . . .                SubHeightC*numSampL−1, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availT is equal to FALSE, the neighbouring top luma                samples pY[x][y] with x=−1 . . . SubWidthC*numSampT−1,                y=−1 . . . −2, are set equal to the luma samples                pY[x][0].            -   When availL is equal to FALSE, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=−1 . . .                SubHeightC*numSampL−1, are set equal to the luma samples                pY[0][y].            -   When numSampT is greater than 0, the neighbouring top                luma samples pY[x][y] with x=0 . . .                SubWidthC*numSampT−1, y=−1, −2, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   ,                -   ,                    ,                    ,                    ,                    ,                    .                -   ,                    ,                    ,                    ,                    ,                    .

5.24. Embodiment 24

The working draft specified in JVET-Q2001-vE may be changed as below.

8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLMIntra Prediction Mode

Inputs to this process are:

-   -   the intra prediction mode predModeIntra,    -   a sample location (xTbC, yTbC) of the top-left sample of the        current transform block relative to the top-left sample of the        current picture,    -   a variable nTbW specifying the transform block width,    -   a variable nTbH specifying the transform block height,    -   a variable cIdx specifying the colour component of the current        block,    -   chroma neighbouring samples p[x][y], with x=−1, y=0 . . .        2*nTbH−1 and x=0 . . . 2*nTbW−1, y=−1.        Output of this process are predicted samples predSamples[x][y],        with x=0 . . . nTbW−1, y=0 . . . nTbH−1.        The current luma location (xTbY, yTbY) is derived as follows:

(xTbY,yTbY)=(xTbC<<(SubWidthC−1),yTbC<<(SubHeightC−1))  (351)

The variables availL, availT and availTL are derived as follows:

-   -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY−1, yTbY), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availL.    -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY, yTbY−1), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availT.    -   ,        -   ,            ,            ,            ,            ,            ,            ,            .    -   ,        .        . . .        The prediction samples predSamples[x][y] with x=0 . . . nTbW−1,        y=0 . . . nTbH−1 are derived as follows:    -   If both numSampL and numSampT are equal to 0, the following        applies:

predSamples[x][y]=1<<(BitDepth−1)  (359)

-   -   Otherwise, the following ordered steps apply:        -   1. The collocated luma samples pY[x][y] with x=0 . . .            nTbW*SubWidthC−1, y=0 . . . nTbH*SubHeightC−1 are set equal            to the reconstructed luma samples prior to the deblocking            filter process at the locations (xTbY+x, yTbY+y).        -   2. The neighbouring luma samples pY[x][y] are derived as            follows:            -   When numSampL is greater than 0, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=0 . . .                SubHeightC*numSampL−1, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availT is equal to FALSE, the neighbouring top luma                samples pY[x][y] with x=−1 . . . SubWidthC*numSampT−1,                y=−1 . . . −2, are set equal to the luma samples                pY[x][0].            -   When availL is equal to FALSE, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=−1 . . .                SubHeightC*numSampL−1, are set equal to the luma samples                pY[0][y].            -   When numSampT is greater than 0, the neighbouring top                luma samples pY[x][y] with x=0 . . .                SubWidthC*numSampT−1, y=−1, −2, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   ,                -   ,                    ,                    ,                    ,                    ,                    .                -   ,                    ,                    ,                    ,                    ,                    .

5.25. Embodiment 25

The working draft specified in JVET-Q2001-vE may be changed as below.

8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLMIntra Prediction Mode

Inputs to this process are:

-   -   the intra prediction mode predModeIntra,    -   a sample location (xTbC, yTbC) of the top-left sample of the        current transform block relative to the top-left sample of the        current picture,    -   a variable nTbW specifying the transform block width,    -   a variable nTbH specifying the transform block height,    -   a variable cIdx specifying the colour component of the current        block,    -   chroma neighbouring samples p[x][y], with x=−1, y=0 . . .        2*nTbH−1 and x=0 . . . 2*nTbW−1, y=−1.        Output of this process are predicted samples predSamples[x][y],        with x=0 . . . nTbW−1, y=0 . . . nTbH−1.        The current luma location (xTbY, yTbY) is derived as follows:

(xTbY,yTbY)=(xTbC<<(SubWidthC−1),yTbC<<(SubHeightC−1))  (351)

The variables availL, availT and availTL are derived as follows:

-   -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY−1, yTbY), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availL.    -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY, yTbY−1), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availT.    -   .        .        ,        ,        ,        ,        ,        ,        .        . . .        The prediction samples predSamples[x][y] with x=0 . . . nTbW−1,        y=0 . . . nTbH−1 are derived as follows:    -   If both numSampL and numSampT are equal to 0, the following        applies:

predSamples[x][y]=1<<(BitDepth−1)  (359)

-   -   Otherwise, the following ordered steps apply:        -   1. The collocated luma samples pY[x][y] with x=0 . . .            nTbW*SubWidthC−1, y=0 . . . nTbH*SubHeightC−1 are set equal            to the reconstructed luma samples prior to the deblocking            filter process at the locations (xTbY+x, yTbY+y).        -   2. The neighbouring luma samples pY[x][y] are derived as            follows:            -   When numSampL is greater than 0, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=0 . . .                SubHeightC*numSampL−1, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availT is equal to FALSE, the neighbouring top luma                samples pY[x][y] with x=−1 . . . SubWidthC*numSampT−1,                y=−1 . . . −2, are set equal to the luma samples                pY[x][0].            -   When availL is equal to FALSE, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=−1 . . .                SubHeightC*numSampL−1, are set equal to the luma samples                pY[0][y].            -   When numSampT is greater than 0, the neighbouring top                luma samples pY[x][y] with x=0 . . .                SubWidthC*numSampT−1, y=−1, −2, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   ,                -   ,                    ,                    ,                    ,                    ,                    .                -   ,                    ,                    ,                    ,                    ,                    .

5.26. Embodiment 26

The working draft specified in JVET-Q2001-vE may be changed as below.

8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLMIntra Prediction Mode

Inputs to this process are:

-   -   the intra prediction mode predModeIntra,    -   a sample location (xTbC, yTbC) of the top-left sample of the        current transform block relative to the top-left sample of the        current picture,    -   a variable nTbW specifying the transform block width,    -   a variable nTbH specifying the transform block height,    -   a variable cIdx specifying the colour component of the current        block,    -   chroma neighbouring samples p[x][y], with x=−1, y=0 . . .        2*nTbH−1 and x=0 . . . 2*nTbW−1, y=−1.        Output of this process are predicted samples predSamples[x][y],        with x=0 . . . nTbW−1, y=0 . . . nTbH−1.        The current luma location (xTbY, yTbY) is derived as follows:

(xTbY,yTbY)=(xTbC<<(SubWidthC−1),yTbC<<(SubHeightC−1))  (351)

The variables availL, availT and availTL are derived as follows:

-   -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY−1, yTbY), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availL.    -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY, yTbY−1), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availT.    -   ,        ,        ,        ,        ,        ,        ,        .        . . .        The prediction samples predSamples[x][y] with x=0 . . . nTbW−1,        y=0 . . . nTbH−1 are derived as follows:    -   If both numSampL and numSampT are equal to 0, the following        applies:

predSamples[x][y]=1<<(BitDepth−1)  (359)

-   -   Otherwise, the following ordered steps apply:        -   1. The collocated luma samples pY[x][y] with x=0 . . .            nTbW*SubWidthC−1, y=0 . . . nTbH*SubHeightC−1 are set equal            to the reconstructed luma samples prior to the deblocking            filter process at the locations (xTbY+x, yTbY+y).        -   2. The neighbouring luma samples pY[x][y] are derived as            follows:            -   When numSampL is greater than 0, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=0 . . .                SubHeightC*numSampL−1, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availT is equal to FALSE, the neighbouring top luma                samples pY[x][y] with x=−1 . . . SubWidthC*numSampT−1,                y=−1 . . . −2, are set equal to the luma samples                pY[x][0].            -   When availL is equal to FALSE, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=−1 . . .                SubHeightC*numSampL−1, are set equal to the luma samples                pY[0][y].            -   When numSampT is greater than 0, the neighbouring top                luma samples pY[x][y] with x=0 . . .                SubWidthC*numSampT−1, y=−1, −2, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   ,                -   ,                    ,                    ,                    ,                    ,                    .                -   ,                    ,                    ,                    ,                    ,                    .

5.27. Embodiment 27

The working draft specified in JVET-Q2001-vE may be changed as below.

8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLMIntra Prediction Mode

The prediction samples predSamples[x][y] with x=0 . . . nTbW−1, y=0 . .. nTbH−1 are derived as follows:

-   -   If both numSampL and numSampT are equal to 0, the following        applies:

predSamples[x][y]=1<<(BitDepth−1)  (359)

-   -   Otherwise, the following ordered steps apply:        -   1. The collocated luma samples pY[x][y] with x=0 . . .            nTbW*SubWidthC−1, y=0 . . . nTbH*SubHeightC−1 are set equal            to the reconstructed luma samples prior to the deblocking            filter process at the locations (xTbY+x, yTbY+y).        -   2. The neighbouring luma samples pY[x][y] are derived as            follows:            -   When numSampL is greater than 0, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=0 . . .                SubHeightC*numSampL−1, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availT is equal to FALSE, the neighbouring top luma                samples pY[x][y] with x=−1 . . . SubWidthC*numSampT−1,                y=−1 . . . −2, are set equal to the luma samples                pY[x][0].            -   When availL is equal to FALSE, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=−1 . . .                SubHeightC*numSampL−1, are set equal to the luma samples                pY[0][y].            -   When numSampT is greater than 0, the neighbouring top                luma samples pY[x][y] with x=0 . . .                SubWidthC*numSampT−1, y=−1, −2, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availTL is equal to TRUE, the neighbouring top-left                luma samples pY[x][y] with x=−1, y=−1, −2 are set equal                to the reconstructed luma samples prior to the                deblocking filter process at the locations (xTbY+x,                yTbY+y).        -   3. The down-sampled collocated luma samples pDsY[x][y] with            x=0 . . . nTbW−1, y=0 . . . nTbH−1 are derived as follows:            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:                -   pDsY[x][y] with x=1 . . . nTbW−1, y=1 . . . nTbH−1                    is derived as follows:

pDstY[x][y]=pY[x][y]  (360)

-   -   -   -   Otherwise, the following applies:                -   The one-dimensional filter coefficients array F1 and                    F2, and the 2-dimensional filter coefficients arrays                    F3 and F4 are specified as follows.

F1[0]=2,F1[1]=0  (361)

F2[0]=1,F2[1]=2,F2[2]=1  (362)

F3[i][j]=F4[i][j]=0,with i=0 . . . 2,j=0 . . . 2  (363)

-   -   -   -   -    If both SubWidthC and SubHeightC are equal to 2,                    the following applies:

F1[0]=1,F1[1]=1  (364)

F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1  (365)

F4[0][1]=1,F4[1][1]=2,F4[2][1]=1  (366)

F4[0][2]=1,F4[1][2]=2,F4[2][2]=1  (367)

-   -   -   -   -    Otherwise, the following applies:

,F3[1][1]=

,

,  (368)

F4[0][1]=2,F4[1][1]=4,F4[2][1]=2,  (369)

-   -   -   -   -   If sps_chromavertical_collocated_flag is equal to 1,                    the following applies:                -    pDsY[x][y] with x=0 . . . nTbW−1, y=0 . . . nTbH−1                    is derived as follows:

pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y−1]+F3[0][1]*pY[SubWidthC*x−1][SubHeightC*y]+F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3  (370)

-   -   -   -   -   Otherwise (sps_chroma_vertical_collocated_flag is                    equal to 0), the following applies:                -    pDsY[x][y] with x=0 . . . nTbW−1, y=0 . . . nTbH−1                    is derived as follows:

pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x−1][SubHeightC*y]+F4[0][2]*pY[SubWidthC*x−1][SubHeightC*y+1]+F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3  (371)

5.28. Embodiment 28

The working draft specified in JVET-Q2001-vE may be changed as below.

8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLMIntra Prediction Mode

Inputs to this process are:

-   -   the intra prediction mode predModeIntra,    -   a sample location (xTbC, yTbC) of the top-left sample of the        current transform block relative to the top-left sample of the        current picture,    -   a variable nTbW specifying the transform block width,    -   a variable nTbH specifying the transform block height,    -   a variable cIdx specifying the colour component of the current        block,    -   chroma neighbouring samples p[x][y], with x=−1, y=0 . . .        2*nTbH−1 and x=0 . . . 2*nTbW−1, y=−1.        Output of this process are predicted samples predSamples[x][y],        with x=0 . . . nTbW−1, y=0 . . . nTbH−1.        The current luma location (xTbY, yTbY) is derived as follows:

(xTbY,yTbY)=(xTbC<<(SubWidthC−1),yTbC<<(SubHeightC−1))  (351)

The variables availL, availT and availTL are derived as follows:

-   -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY−1, yTbY), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availL.    -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY, yTbY−1), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availT.    -   The variable availTL is derived as follows:

availTL=availL&&availT  (352)

-   -   The number of available top-right neighbouring chroma samples        numTopRight is derived as follows:        -   The variable numTopRight is set equal to 0 and availTR is            set equal to TRUE.        -   When predModeIntra is equal to INTRA_T_CCLM, the following            applies for x=nTbW . . . 2*nTbW−1 until availTR is equal to            FALSE or x is equal to 2*nTbW−1:            -   The derivation process for neighbouring block                availability as specified in clause 6.4.4 is invoked                with the current luma location (xCurr, yCurr) set equal                to (xTbY, yTbY) the neighbouring luma location (xTbY+x,                yTbY−1), checkPredModeY set equal to FALSE, and cIdx as                inputs, and the output is assigned to availTR            -   When availTR is equal to TRUE, numTopRight is                incremented by one.    -   The number of available left-below neighbouring chroma samples        numLeftBelow is derived as follows:        -   The variable numLeftBelow is set equal to 0 and availLB is            set equal to TRUE.        -   When predModeIntra is equal to INTRA_L_CCLM, the following            applies for y=nTbH . . . 2*nTbH−1 until availLB is equal to            FALSE or y is equal to 2*nTbH−1:            -   The derivation process for neighbouring block                availability as specified in clause 6.4.4 is invoked                with the current luma location (xCurr, yCurr) set equal                to (xTbY, yTbY), the neighbouring luma location (xTbY−1,                yTbY+y), checkPredModeY set equal to FALSE, and cIdx as                inputs, and the output is assigned to availLB            -   When availLB is equal to TRUE, numLeftBelow is                incremented by one.                The number of available neighbouring chroma samples on                the top and top-right numSampT and the number of                available neighbouring chroma samples on the left and                left-below numSampL are derived as follows:    -   If predModeIntra is equal to INTRA_LT_CCLM, the following        applies:

numSampT=availT?nTbW:0  (353)

numSampL=availL?nTbH:0  (354)

-   -   Otherwise, the following applies:

numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0  (355)

numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0  (356)

The variable bCTUboundary is derived as follows:

bCTUboundary=(yTbY&(CtbSizeY−1)==0)?TRUE:FALSE.  (357)

The variable cntN and array pickPosN with N being replaced by L and T,are derived as follows:

-   -   The variable numIs4N is derived as follows:

numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1)  (358)

-   -   The variable startPosN is set equal to numSampN>>(2+numIs4N).    -   The variable pickStepN is set equal to Max(1,        numSampN>>(1+numIs4N)).    -   If availN is equal to TRUE and predModeIntra is equal to        INTRA_LT_CCLM or INTRA_N_CCLM, the following assignments are        made:        -   cntN is set equal to Min(numSampN, (1+numIs4N)<<1).        -   pickPosN[pos] is set equal to (startPosN+pos*pickStepN),            with pos=0 . . . cntN−1.    -   Otherwise, cntN is set equal to 0.        .        The prediction samples predSamples[x][y] with x=0 . . . nTbW−1,        y=0 . . . nTbH−1 are derived as follows:    -   If both numSampL and numSampT are equal to 0, the following        applies:

predSamples[x][y]=1<<(BitDepth−1)  (359)

-   -   Otherwise, the following ordered steps apply:        -   1. The collocated luma samples pY[x][y] with x=0 . . .            nTbW*SubWidthC−1, y=0 . . . nTbH*SubHeightC−1 are set equal            to the reconstructed luma samples prior to the deblocking            filter process at the locations (xTbY+x, yTbY+y).        -   2. The neighbouring luma samples pY[x][y] are derived as            follows:            -   When numSampL is greater than 0, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=0 . . .                SubHeightC*numSampL−1, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availT is equal to FALSE, the neighbouring top luma                samples pY[x][y] with x=−1 . . . SubWidthC*numSampT−1,                y=−1 . . . −2, are set equal to the luma samples                pY[x][0].            -   When availL is equal to FALSE, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=−1 . . .                SubHeightC*numSampL−1, are set equal to the luma samples                pY[0][y].            -   When numSampT is greater than 0, the neighbouring top                luma samples pY[x][y] with x=0 . . .                SubWidthC*numSampT−1, y=−1, −2, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availTL is equal to TRUE, the neighbouring top-left                luma samples pY[x][y] with x=−1, y=−1, −2, are set equal                to the reconstructed luma samples prior to the                deblocking filter process at the locations (xTbY+x,                yTbY+y).        -   3. The down-sampled collocated luma samples pDsY[x][y] with            x=0 . . . nTbW−1, y=0 . . . nTbH−1 are derived as follows:            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:                -   pDsY[x][y] with x=1 . . . nTbW−1, y=1. nTbH−1 is                    derived as follows:

pDstY[x][y]=pY[x][y]  (360)

-   -   -   -   Otherwise, the following applies:                -   The one-dimensional filter coefficients array F1 and                    F2, and the 2-dimensional filter coefficients arrays                    F3 and F4 are specified as follows.

F1[0]=2,F1[1]=0  (361)

F2[0]=1,F2[1]=2,F2[2]=1  (362)

F3[i][j]=F4[i][j]=0,with i=0 . . . 2,j=0 . . . 2  (363)

-   -   -   -   -    If both SubWidthC and SubHeightC are equal to 2,                    the following applies:

F1[0]=1,F1[1]=1  (364)

F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[2]=1  (365)

F4[0][1]=1,F4[1][1]=2,F4[2][1]=1  (366)

F4[0][2]=1,F4[1][2]=2,F4[2][2]=1  (367)

-   -   -   -   -                    -    Otherwise, the following applies:

F3[1][1]=8  (368)

F4[0][1]=2,F4[1][1]=4,F4[2][1]=2,  (369)

-   -   -   -   -                    -   If                    is equal to 1, the following applies:                -    pDsY[x][y] with x=0 . . . nTbW−1, y=0 . . . nTbH−1                    is derived as follows:

pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y−1]+F3[0][1]*pY[SubWidthC*x−1][SubHeightC*y]+F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3  (371)

-   -   -   -   -   Otherwise (                    is equal to 0), the following applies:                -    pDsY[x][y] with x=0 . . . nTbW−1, y=0 . . . nTbH−1                    is derived as follows:

pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x−1][SubHeightC*y]+F4[0][2]*pY[SubWidthC*x−1][SubHeightC*y+1]+F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3  (371)

-   -   -   4. When numSampL is greater than 0, the selected            neighbouring left chroma samples pSelC[idx] are set equal to            p[−1][pickPosL[idx]] with idx=0 . . . cntL−1, and the            selected down-sampled neighbouring left luma samples            pSelDsY[idx] with idx=0 . . . cntL−1 are derived as follows:            -   The variable y is set equal to pickPosL[idx].            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:

pSelDsY[idx]=pY[−1][y]  (372)

-   -   -   -   Otherwise the following applies:                -   If                    is equal to 1, the following applies:

pSelDsY[idx]=(F3[1][0]*pY[−SubWidthC][SubHeightC*y−1]+F3[0][1]*pY[−1−SubWidthC][SubHeightC*y]+F3[1][1]*pY[−SubWidthC][SubHeightC*y]+F3[2][1]*pY[1−SubWidthC][SubHeightC*y]+F3[1][2]*pY[−SubWidthC][SubHeightC*y+1]+4)>>3  (373)

-   -   -   -   -   Otherwise (                    is equal to 0), the following applies:

pSelDsY[idx]=(F4[0][1]*pY[−1−SubWidthC][SubHeightC*y]+F4[0][2]*pY[−1−SubWidthC][SubHeightC*y]+1+F4[1][1]*pY[−SubWidthC][SubHeightC*y]+F4[1][2]*pY[−SubWidthC][SubHeightC*y+1]+F4[2][1]*pY[1−SubWidthC][SubHeightC*y]+F4[2][2]*pY[1−SubWidthC][SubHeightC*y+1]+4)>>3  (374)

-   -   -   5. When numSampT is greater than 0, the selected            neighbouring top chroma samples pSelC[idx] are set equal to            p[pickPosT[idx−cntL]][−1] with idx=cntL . . . cntL+cntT−1,            and the down-sampled neighbouring top luma samples            pSelDsY[idx] with idx=            . . . cntL+cntT−1 are specified as follows:            -   The variable x is set equal to pickPosT[idx−cntL].            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:

pSelDsY[idx]=pY[x][−1]  (375)

-   -   -   -   Otherwise, the following applies:                -   If                    is equal to 1, the following applies:                -    If bCTUboundary is equal to FALSE, the following                    applies:

pSelDsY[idx]=(F3[1][0]*pY[SubWidthC*x][−1−SubHeightC]+F3[0][1]*pY[SubWidthC*x−1][−SubHeightC]+F3[1][1]*pY[SubWidthC*x][−SubHeightC]+F3[2][1]*pY[SubWidthC*x+1][−SubHeightC]+F3[1][2]*pY[SubWidthC*x][1−SubHeightC]+4)>>3  (376)

-   -   -   -   -    Otherwise (bCTUboundary is equal to TRUE), the                    following applies:

pSelDsY[idx]=(F2[0]*pY[SubWidthC*x−1][−1]+F2[1]*pY[SubWidthC*x][−1]+F2[2]*pY[SubWidthC*x+1][−1]+2)>>2  (377)

-   -   -   -   -   Otherwise (                    is equal to 0), the following applies:                -    If bCTUboundary is equal to FALSE, the following                    applies:

pSelDsY[idx]=(F4[0][1]*pY[SubWidthCx−1][−1]+F4[0][2]*pY[SubWidthC*x−1][−2]+F4[1][1]*pY[SubWidthC*x][−1]+F4[1][2]*pY[SubWidthC*x][−2]+F4[2][1]*pY[SubWidthC*x+1][−1]+F4[2][2]*pY[SubWidthC*x+1][−2]+4)>>3  (378)

-   -   -   -   -    Otherwise (bCTUboundary is equal to TRUE), the                    following applies:

pSelDsY[idx]=(F2[0]*pY[SubWidthC*x−1][−1]+F2[1]*pY[SubWidthC*x][−1]+F2[2]*pY[SubWidthC*x+1][−1]+2)>>2  (379)

-   -   -   6. When cntT+cntL is not equal to 0, the variables minY,            maxY, minC and maxC are derived as follows:            -   When cntT+cntL is equal to 2, pSelComp[3] is set equal                to pSelComp[0], pSelComp[2] is set equal to pSelComp[1],                pSelComp[0] is set equal to pSelComp[1], and pSelComp[1]                is set equal to pSelComp[3], with Comp being replaced by                DsY and C.            -   The arrays minGrpIdx and maxGrpIdx are derived as                follows:

minGrpIdx[0]=0  (380)

minGrpIdx[1]=2  (381)

maxGrpIdx[0]=1  (382)

maxGrpIdx[1]=3  (383)

-   -   -   -   When pSelDsY[minGrpIdx[0]] is greater than                pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are                swapped as follows:

(minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1])  (384)

-   -   -   -   When pSelDsY[maxGrpIdx[0]] is greater than                pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are                swapped as follows:

(maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1])  (385)

-   -   -   -   When pSelDsY[minGrpIdx[0]] is greater than                pSelDsY[maxGrpIdx[1]], arrays minGrpIdx and maxGrpIdx                are swapped as follows:

(minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx)  (386)

-   -   -   -   When pSelDsY[minGrpIdx[1]] is greater than                pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are                swapped as follows:

(minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0])  (387)

-   -   -   -   The variables maxY, maxC, minY and minC are derived as                follows:

maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1  (388)

maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1  (389)

minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1  (390)

minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1  (391)

-   -   -   7. The variables a, b, and k are derived as follows:            -   If numSampL is equal to 0, and numSampT is equal to 0,                the following applies:

k=0  (392)

a=0  (393)

b=1<<(BitDepth−1)  (394)

-   -   -   -   Otherwise, the following applies:

diff=maxY−minY  (395)

-   -   -   -   -   If diff is not equal to 0, the following applies:

diffC=maxC−minC  (396)

x=Floor(Log 2(diff))  (397)

normDiff=((diff<<4)>>x)&15  (398)

x+=(normDiff !=0)?1:0  (399)

y=Abs(diffC)>0?Floor(Log 2(Abs(diffC)))+1:0  (400)

a=(diffC*(divSigTable[normDiff]|8)+2^(y-1))>>y  (401)

k=((3+x−y)<1)?1:3+x−y  (402)

a=((3+x−y)<1)?Sign(a)*15:a  (403)

b=minC−((a*minY)>>k)  (404)

-   -   -   -   -    where divSigTable[ ] is specified as follows:

divSigTable[ ]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0}  (405)

-   -   -   -   -   Otherwise (diff is equal to 0), the following                    applies:

k=0  (406)

a=0  (407)

b=minC  (408)

-   -   -   8. The prediction samples predSamples[x][y] with x=0 . . .            nTbW−1, y=0 . . . nTbH−1 are derived as follows:

predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b)  (409)

-   -   NOTE—This process uses sps_chroma_vertical_collocated_flag.        However, in order to simplify implementation, it does not use        sps_chroma_horizontal_collocated_flag.

5.29. Embodiment 29

The working draft specified in JVET-Q2001-vE may be changed as below.

8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLMIntra Prediction Mode

The prediction samples predSamples[x][y] with x=0 . . . nTbW−1, y=0 . .. nTbH−1 are derived as follows:

-   -   If both numSampL and numSampT are equal to 0, the following        applies:

predSamples[x][y]=1<<(BitDepth−1)  (359)

-   -   Otherwise, the following ordered steps apply:        -   1. The collocated luma samples pY[x][y] with x=0 . . .            nTbW*SubWidthC−1, y=0 . . . nTbH*SubHeightC−1 are set equal            to the reconstructed luma samples prior to the deblocking            filter process at the locations (xTbY+x, yTbY+y).        -   2. The neighbouring luma samples pY[x][y] are derived as            follows:            -   When                , the neighbouring left luma samples pY[x][y] with x=−1                . . . −3, y=0 . . . SubHeightC*max(numSampL,                −1, are set equal to the reconstructed luma samples                prior to the deblocking filter process at the locations                (xTbY+x, yTbY+y).            -   When availT is equal to FALSE, the neighbouring top luma                samples pY[x][y] with x=−1 . . . SubWidthC*numSampT−1,                y=−1 . . . −2, are set equal to the luma samples                pY[x][0].            -   When availL is equal to FALSE, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=−1 . . .                SubHeightC*numSampL−1, are set equal to the luma samples                pY[0][y].            -   When                , the neighbouring top luma samples pY[x][y] with x=0 .                . . SubWidthC*max(numSampT,                −1, y=−1, −2, are set equal to the reconstructed luma                samples prior to the deblocking filter process at the                locations (xTbY+x, yTbY+y).            -   When availTL is equal to TRUE, the neighbouring top-left                luma samples pY[x][y] with x=−1, y=−1, −2 are set equal                to the reconstructed luma samples prior to the                deblocking filter process at the locations (xTbY+x,                yTbY+y).

5.30. Embodiment 30

The working draft specified in JVET-Q2001-vE may be changed as below.

8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLMIntra Prediction Mode

The prediction samples predSamples[x][y] with x=0 . . . nTbW−1, y=0 . .. nTbH−1 are derived as follows:

-   -   If both numSampL and numSampT are equal to 0, the following        applies:

predSamples[x][y]=1<<(BitDepth−1)  (359)

-   -   Otherwise, the following ordered steps apply:        -   1. The collocated luma samples pY[x][y] with x=0 . . .            nTbW*SubWidthC−1, y=0 . . . nTbH*SubHeightC−1 are set equal            to the reconstructed luma samples prior to the deblocking            filter process at the locations (xTbY+x, yTbY+y).        -   2. The neighbouring luma samples pY[x][y] are derived as            follows:            -   When numSampL is greater than 0, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=0 . . .                SubHeightC*numSampL−1, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   ,                ,                ,                ,                .            -   When availT is equal to FALSE, the neighbouring top luma                samples pY[x][y] with x=−1 . . . SubWidthC*numSampT−1,                y=−1 . . . −2, are set equal to the luma samples                pY[x][0].            -   When availL is equal to FALSE, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=−1 . . .                SubHeightC*numSampL−1, are set equal to the luma samples                pY[0][y].            -   When numSampT is greater than 0, the neighbouring top                luma samples pY[x][y] with x=0 . . .                SubWidthC*numSampT−1, y=−1, −2, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   ,                ,                ,                ,                .            -   When availTL is equal to TRUE, the neighbouring top-left                luma samples pY[x][y] with x=−1, y=−1, −2 are set equal                to the reconstructed luma samples prior to the                deblocking filter process at the locations (xTbY+x,                yTbY+y).

5.31. Embodiment 31

The working draft specified in JVET-Q2001-vE may be changed as below.

8.4.5.2.13 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLMIntra Prediction Mode

Inputs to this process are:

-   -   the intra prediction mode predModeIntra,    -   a sample location (xTbC, yTbC) of the top-left sample of the        current transform block relative to the top-left sample of the        current picture,    -   a variable nTbW specifying the transform block width,    -   a variable nTbH specifying the transform block height,    -   a variable cIdx specifying the colour component of the current        block,    -   chroma neighbouring samples p[x][y], with x=−1, y=0 . . .        2*nTbH−1 and x=0 . . . 2*nTbW−1, y=−1.        Output of this process are predicted samples predSamples[x][y],        with x=0 . . . nTbW−1, y=0 . . . nTbH−1.        The current luma location (xTbY, yTbY) is derived as follows:

(xTbY,yTbY)=(xTbC<<(SubWidthC−1),yTbC<<(SubHeightC−1))  (351)

The variables availL, availT and availTL are derived as follows:

-   -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY−1, yTbY), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availL.    -   The derivation process for neighbouring block availability as        specified in clause 6.4.4 is invoked with the current luma        location (xCurr, yCurr) set equal to (xTbY, yTbY), the        neighbouring luma location (xTbY, yTbY−1), checkPredModeY set        equal to FALSE, and cIdx as inputs, and the output is assigned        to availT.    -   The variable availTL is derived as follows:

availTL=availL&&availT  (352)

-   -   The number of available top-right neighbouring chroma samples        numTopRight is derived as follows:        -   The variable numTopRight is set equal to 0 and availTR is            set equal to TRUE.        -   When predModeIntra is equal to INTRA_T_CCLM, the following            applies for x=nTbW . . . 2*nTbW−1 until availTR is equal to            FALSE or x is equal to 2*nTbW−1:            -   The derivation process for neighbouring block                availability as specified in clause 6.4.4 is invoked                with the current luma location (xCurr, yCurr) set equal                to (xTbY, yTbY) the neighbouring luma location (xTbY+x,                yTbY−1), checkPredModeY set equal to FALSE, and cIdx as                inputs, and the output is assigned to availTR            -   When availTR is equal to TRUE, numTopRight is                incremented by one.    -   The number of available left-below neighbouring chroma samples        numLeftBelow is derived as follows:        -   The variable numLeftBelow is set equal to 0 and availLB is            set equal to TRUE.        -   When predModeIntra is equal to INTRA_L_CCLM, the following            applies for y=nTbH . . . 2*nTbH−1 until availLB is equal to            FALSE or y is equal to 2*nTbH−1:            -   The derivation process for neighbouring block                availability as specified in clause 6.4.4 is invoked                with the current luma location (xCurr, yCurr) set equal                to (xTbY, yTbY), the neighbouring luma location (xTbY−1,                yTbY+y), checkPredModeY set equal to FALSE, and cIdx as                inputs, and the output is assigned to availLB            -   When availLB is equal to TRUE, numLeftBelow is                incremented by one.                The number of available neighbouring chroma samples on                the top and top-right numSampT and the number of                available neighbouring chroma samples on the left and                left-below numSampL are derived as follows:    -   If predModeIntra is equal to INTRA_LT_CCLM, the following        applies:

numSampT=availT?nTbW:0  (353)

numSampL=availL?nTbH:0  (354)

-   -   Otherwise, the following applies:

numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0  (355)

numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0  (356)

The variable bCTUboundary is derived as follows:

bCTUboundary=(yTbY&(CtbSizeY−1)==0)?TRUE:FALSE.  (357)

The variable cntN and array pickPosN with N being replaced by L and T,are derived as follows:

-   -   The variable numIs4N is derived as follows:

numIs4N=((availT&&availL&&predModeIntra==INTRA_LT_CCLM)?0:1)  (358)

-   -   The variable startPosN is set equal to numSampN>>(2+numIs4N).    -   The variable pickStepN is set equal to Max(1,        numSampN>>(1+numIs4N)).    -   If availN is equal to TRUE and predModeIntra is equal to        INTRA_LT_CCLM or INTRA_N_CCLM, the following assignments are        made:        -   cntN is set equal to Min(numSampN, (1+numIs4N)<<1).        -   pickPosN[pos] is set equal to (startPosN+pos*pickStepN),            with pos=0 . . . cntN−1.    -   Otherwise, cntN is set equal to 0.        .        The prediction samples predSamples[x][y] with x=0 . . . nTbW−1,        y=0 . . . nTbH−1 are derived as follows:    -   If both numSampL and numSampT are equal to 0, the following        applies:

predSamples[x][y]=1<<(BitDepth−1)  (359)

-   -   Otherwise, the following ordered steps apply:        -   1. The collocated luma samples pY[x][y] with x=0 . . .            nTbW*SubWidthC−1, y=0 . . . nTbH*SubHeightC−1 are set equal            to the reconstructed luma samples prior to the deblocking            filter process at the locations (xTbY+x, yTbY+y).        -   2. The neighbouring luma samples pY[x][y] are derived as            follows:            -   When numSampL is greater than 0, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=0 . . .                SubHeightC*numSampL−1, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availT is equal to FALSE, the neighbouring top luma                samples pY[x][y] with x=−1 . . . SubWidthC*numSampT−1,                y=−1 . . . −2, are set equal to the luma samples                pY[x][0].            -   When availL is equal to FALSE, the neighbouring left                luma samples pY[x][y] with x=−1 . . . -3, y=−1 . . .                SubHeightC*numSampL−1, are set equal to the luma samples                pY[0][y].            -   When numSampT is greater than 0, the neighbouring top                luma samples pY[x][y] with x=0 . . .                SubWidthC*numSampT−1, y=−1, −2, are set equal to the                reconstructed luma samples prior to the deblocking                filter process at the locations (xTbY+x, yTbY+y).            -   When availTL is equal to TRUE, the neighbouring top-left                luma samples pY[x][y] with x=−1, y=−1, −2, are set equal                to the reconstructed luma samples prior to the                deblocking filter process at the locations (xTbY+x,                yTbY+y).        -   3. The down-sampled collocated luma samples pDsY[x][y] with            x=0 . . . nTbW−1, y=0 . . . nTbH−1 are derived as follows:            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:                -   pDsY[x][y] with x=1 . . . nTbW−1, y=1 . . . nTbH−1                    is derived as follows:

pDstY[x][y]=pY[x][y]  (360)

-   -   -   -   Otherwise, the following applies:                -   The one-dimensional filter coefficients array F1 and                    F2, and the 2-dimensional filter coefficients arrays                    F3 and F4 are specified as follows.

F1[0]=2,F1[1]=0  (361)

F2[0]=1,F2[1]=2,F2[2]=1  (362)

F3[i][j]=F4[i][j]=0,with i=0 . . . 2,j=0 . . . 2  (363)

-   -   -   -   -    If both SubWidthC and SubHeightC are equal to 2,                    the following applies:

F1[0]=1,F1[1]=1  (364)

F3[0][1]=1,F3[1][1]=4,F3[2][1]=1,F3[1][0]=1,F3[1][2]=1  (365)

F4[0][1]=1,F4[1][1]=2,F4[2][1]=1  (366)

F4[0][2]=1,F4[1][2]=2,F4[2][2]=1  (367)

-   -   -   -   -                    -    Otherwise, the following applies:

F3[1][1]=8  (368)

F4[0][1]=2,F4[1][1]=4,F4[2][1]=2,  (369)

-   -   -   -   -                    -   If                    is equal to 1, the following applies:                -    pDsY[x][y] with x=0 . . . nTbW−1, y=0 . . . nTbH−1                    is derived as follows:

pDsY[x][y]=(F3[1][0]*pY[SubWidthC*x][SubHeightC*y−1]+F3[0][1]*pY[SubWidthC*x−1][SubHeightC*y]+F3[1][1]*pY[SubWidthC*x][SubHeightC*y]+F3[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+F3[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+4)>>3  (370)

-   -   -   -   -   Otherwise (                    is equal to 0), the following applies:                -    pDsY[x][y] with x=0 . . . nTbW−1, y=0 . . . nTbH−1                    is derived as follows:

pDsY[x][y]=(F4[0][1]*pY[SubWidthC*x−1][SubHeightC*y]+F4[0][2]*pY[SubWidthC*x−1][SubHeightC*y+1]+F4[1][1]*pY[SubWidthC*x][SubHeightC*y]+F4[1][2]*pY[SubWidthC*x][SubHeightC*y+1]+F4[2][1]*pY[SubWidthC*x+1][SubHeightC*y]+F4[2][2]*pY[SubWidthC*x+1][SubHeightC*y+1]+4)>>3  (371)

-   -   -   4. When numSampL is greater than 0, the selected            neighbouring left chroma samples pSelC[idx] are set equal to            p[−1][pickPosL[idx]] with idx=0 . . . cntL−1, and the            selected down-sampled neighbouring left luma samples            pSelDsY[idx] with idx=0 . . . cntL−1 are derived as follows:            -   The variable y is set equal to pickPosL[idx].            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:

pSelDsY[idx]=pY[−1][y]  (372)

-   -   -   -   Otherwise the following applies:                -   If                    is equal to 1, the following applies:

pSelDsY[idx]=(F3[1][0]*pY[−SubWidthC][SubHeightC*y−1]+F3[0][1]*pY[−1−SubWidthC][SubHeightC*y]+F3[1][1]*pY[−SubWidthC][SubHeightC*y]+F3[2][1]*pY[1−SubWidthC][SubHeightC*y]+F3[1][2]*pY[−SubWidthC][SubHeightC*y+1]+4)>>3  (373)

-   -   -   -   -   Otherwise (                    equal to 0), the following applies:

pSelDsY[idx]=(F4[0][1]*pY[−1−SubWidthC][SubHeightC*y]+F4[0][2]*pY[−1−SubWidthC][SubHeightC*y]+1+F4[1][1]*pY[−SubWidthC][SubHeightC*y]+F4[1][2]*pY[−SubWidthC][SubHeightC*y+1]+F4[2][1]*pY[1−SubWidthC][SubHeightC*y]+F4[2][2]*pY[1−SubWidthC][SubHeightC*y+1]+4)>>3  (374)

-   -   -   5. When numSampT is greater than 0, the selected            neighbouring top chroma samples pSelC[idx] are set equal to            p[pickPosT[idx−cntL]][−1] with idx=cntL . . . cntL+cntT−1,            and the down-sampled neighbouring top luma samples            pSelDsY[idx] with idx=            . . . cntL+cntT−1 are specified as follows:            -   The variable x is set equal to pickPosT[idx−cntL].            -   If both SubWidthC and SubHeightC are equal to 1, the                following applies:

pSelDsY[idx]=pY[x][−1]  (375)

-   -   -   -   Otherwise, the following applies:                -   If                    is equal to 1, the following applies:                -    If bCTUboundary is equal to FALSE, the following                    applies:

pSelDsY[idx]=(F3[1][0]*pY[SubWidthC*x][−1−SubHeightC]+F3[0][1]*pY[SubWidthC*x−1][−SubHeightC]+F3[1][1]*pY[SubWidthC*x][−SubHeightC]+F3[2][1]*pY[SubWidthC*x+1][−SubHeightC]+F3[1][2]*pY[SubWidthC*x][1−SubHeightC]+4)>>3  (376)

-   -   -   -   -    Otherwise (bCTUboundary is equal to TRUE), the                    following applies:

pSelDsY[idx]=(F2[0]*pY[SubWidthC*x−1][−1]+F2[1]*pY[SubWidthC*x][−1]+F2[2]*pY[SubWidthC*x+1][−1]+2)>>2  (377)

-   -   -   -   -   Otherwise (                    is equal to 0), the following applies:                -    If bCTUboundary is equal to FALSE, the following                    applies:

pSelDsY[idx]=(F4[0][1]*pY[SubWidthCx−1][−1]+F4[0][2]*pY[SubWidthC*x−1][−2]+F4[1][1]*pY[SubWidthC*x][−1]+F4[1][2]*pY[SubWidthC*x][−2]+F4[2][1]*pY[SubWidthC*x+1][−1]+F4[2][2]*pY[SubWidthC*x+1][−2]+4)>>3  (378)

-   -   -   -   -    Otherwise (bCTUboundary is equal to TRUE), the                    following applies:

pSelDsY[idx]=(F2[0]*pY[SubWidthC*x−1][−1]+F2[1]*pY[SubWidthC*x][−1]+F2[2]*pY[SubWidthC*x+1][−1]+2)>>2  (379)

-   -   -   6. When cntT+cntL is not equal to 0, the variables minY,            maxY, minC and maxC are derived as follows:            -   When cntT+cntL is equal to 2, pSelComp[3] is set equal                to pSelComp[0], pSelComp[2] is set equal to pSelComp[1],                pSelComp[0] is set equal to pSelComp[1], and pSelComp[1]                is set equal to pSelComp[3], with Comp being replaced by                DsY and C.            -   The arrays minGrpIdx and maxGrpIdx are derived as                follows:

minGrpIdx[0]=0  (380)

minGrpIdx[1]=2  (381)

maxGrpIdx[0]=1  (382)

maxGrpIdx[1]=3  (383)

-   -   -   -   When pSelDsY[minGrpIdx[0]] is greater than                pSelDsY[minGrpIdx[1]], minGrpIdx[0] and minGrpIdx[1] are                swapped as follows:

(minGrpIdx[0],minGrpIdx[1])=Swap(minGrpIdx[0],minGrpIdx[1])  (384)

-   -   -   -   When pSelDsY[maxGrpIdx[0]] is greater than                pSelDsY[maxGrpIdx[1]], maxGrpIdx[0] and maxGrpIdx[1] are                swapped as follows:

(maxGrpIdx[0],maxGrpIdx[1])=Swap(maxGrpIdx[0],maxGrpIdx[1])  (385)

-   -   -   -   When pSelDsY[minGrpIdx[0]] is greater than                pSelDsY[maxGrpIdx[1]], arrays minGrpIdx and maxGrpIdx                are swapped as follows:

(minGrpIdx,maxGrpIdx)=Swap(minGrpIdx,maxGrpIdx)  (386)

-   -   -   -   When pSelDsY[minGrpIdx[1]] is greater than                pSelDsY[maxGrpIdx[0]], minGrpIdx[1] and maxGrpIdx[0] are                swapped as follows:

(minGrpIdx[1],maxGrpIdx[0])=Swap(minGrpIdx[1],maxGrpIdx[0])  (387)

-   -   -   -   The variables maxY, maxC, minY and minC are derived as                follows:

maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1  (388)

maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1  (389)

minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1  (390)

minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1  (391)

-   -   -   7. The variables a, b, and k are derived as follows:            -   If numSampL is equal to 0, and numSampT is equal to 0,                the following applies:

k=0  (392)

a=0  (393)

b=1<<(BitDepth−1)  (394)

-   -   -   -   Otherwise, the following applies:

diff=maxY−minY  (395)

-   -   -   -   -   If diff is not equal to 0, the following applies:

diffC=maxC−minC  (396)

x=Floor(Log 2(diff))  (397)

normDiff=((diff<<4)>>x)&15  (398)

x+=(normDiff !=0)?1:0  (399)

y=Abs(diffC)>0?Floor(Log 2(Abs(diffC)))+1:0  (400)

a=(diffC*(divSigTable[normDiff]|8)+2^(y-1))>>y  (401)

k=((3+x−y)<1)?1:3+x−y  (402)

a=((3+x−y)<1)?Sign(a)*15:a  (403)

b=minC−((a*minY)>>k)  (404)

-   -   -   -   -    where divSigTable[ ] is specified as follows:

divSigTable[ ]=0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0  (405)

-   -   -   -   -   Otherwise (diff is equal to 0), the following                    applies:

k=0  (406)

a=0  (407)

b=minC  (408)

-   -   -   8. The prediction samples predSamples[x][y] with x=0 . . .            nTbW−1, y=0 . . . nTbH−1 are derived as follows:

predSamples[x][y]=Clip1(((pDsY[x][y]*a)>>k)+b)  (409)

-   -   NOTE—This process uses sps_chroma_vertical_collocated_flag.        However, in order to simplify implementation, it does not use        sps_chroma_horizontal_collocated_flag.

FIG. 9 is a block diagram of a video processing apparatus 900. Theapparatus 900 may be used to implement one or more of the methodsdescribed herein. The apparatus 900 may be embodied in a smartphone,tablet, computer, Internet of Things (IoT) receiver, and so on. Theapparatus 900 may include one or more processors 902, one or morememories 904 and video processing hardware 906. The processor(s) 902 maybe configured to implement one or more methods described in the presentdisclosure. The memory (memories) 904 may be used for storing data andcode used for implementing the methods and techniques described herein.The video processing hardware 906 may be used to implement, in hardwarecircuitry, some techniques described in the present disclosure (e.g.,listed in the previous section).

FIG. 10 shows block diagram of a video encoder.

FIG. 11 is a flowchart for a method 1100 of processing a video. Themethod 1100 includes deriving (1102), for a conversion between a chromablock of a video and a coded representation of the video, parameters ofa cross-component linear model by using downsampled collocatedneighboring top luma samples that are generated from N above neighboringlines of a collocated luma block using a downsampling filter, where N isa positive integer, and performing (1104) the conversion using apredicted chroma block generated using the cross-component linear model.

FIG. 12 is a block diagram showing an example video processing system1200 in which various techniques disclosed herein may be implemented.Various implementations may include some or all of the components of thesystem 1200. The system 1200 may include input 1202 for receiving videocontent. The video content may be received in a raw or uncompressedformat, e.g., 8 or 10 bit multi-component pixel values, or may be in acompressed or encoded format. The input 1202 may represent a networkinterface, a peripheral bus interface, or a storage interface. Examplesof network interface include wired interfaces such as Ethernet, passiveoptical network (PON), etc. and wireless interfaces such as wirelessfidelity (Wi-Fi) or cellular interfaces.

The system 1200 may include a coding component 1204 that may implementthe various coding or encoding methods described in the presentdisclosure. The coding component 1204 may reduce the average bitrate ofvideo from the input 1202 to the output of the coding component 1204 toproduce a coded representation of the video. The coding techniques aretherefore sometimes called video compression or video transcodingtechniques. The output of the coding component 1204 may be eitherstored, or transmitted via a communication connected, as represented bythe component 1206. The stored or communicated bitstream (or coded)representation of the video received at the input 1202 may be used bythe component 1208 for generating pixel values or displayable video thatis sent to a display interface 1210. The process of generatinguser-viewable video from the bitstream representation is sometimescalled video decompression. Furthermore, while certain video processingoperations are referred to as “coding” operations or tools, it will beappreciated that the coding tools or operations are used at an encoderand corresponding decoding tools or operations that reverse the resultsof the coding will be performed by a decoder.

Examples of a peripheral bus interface or a display interface mayinclude universal serial bus (USB) or high definition multimediainterface (HDMI) or Displayport, and so on. Examples of storageinterfaces include serial advanced technology attachment (SATA),peripheral component interconnect (PCI), integrated drive electronics(IDE) interface, and the like. The techniques described in the presentdisclosure may be embodied in various electronic devices such as mobilephones, laptops, smartphones or other devices that are capable ofperforming digital data processing and/or video display.

FIG. 14 is a block diagram that illustrates an example video codingsystem 100 that may utilize the techniques of this disclosure.

As shown in FIG. 14 , video coding system 100 may include a sourcedevice 110 and a destination device 120. Source device 110 generatesencoded video data which may be referred to as a video encoding device.Destination device 120 may decode the encoded video data generated bysource device 110 which may be referred to as a video decoding device.

Source device 110 may include a video source 112, a video encoder 114,and an input/output (I/O) interface 116.

Video source 112 may include a source such as a video capture device, aninterface to receive video data from a video content provider, and/or acomputer graphics system for generating video data, or a combination ofsuch sources. The video data may comprise one or more pictures. Videoencoder 114 encodes the video data from video source 112 to generate abitstream. The bitstream may include a sequence of bits that form acoded representation of the video data. The bitstream may include codedpictures and associated data. The coded picture is a codedrepresentation of a picture. The associated data may include sequenceparameter sets, picture parameter sets, and other syntax structures. I/Ointerface 116 may include a modulator/demodulator (modem) and/or atransmitter. The encoded video data may be transmitted directly todestination device 120 via I/O interface 116 through network 130 a. Theencoded video data may also be stored onto a storage medium/server 130 bfor access by destination device 120.

Destination device 120 may include an I/O interface 126, a video decoder124, and a display device 122.

I/O interface 126 may include a receiver and/or a modem. I/O interface126 may acquire encoded video data from the source device 110 or thestorage medium/server 130 b. Video decoder 124 may decode the encodedvideo data. Display device 122 may display the decoded video data to auser. Display device 122 may be integrated with the destination device120, or may be external to destination device 120 which be configured tointerface with an external display device.

Video encoder 114 and video decoder 124 may operate according to a videocompression standard, such as the High Efficiency Video Coding (HEVC)standard, Versatile Video Coding (VVC) standard and other current and/orfurther standards.

FIG. 15 is a block diagram illustrating an example of video encoder 200,which may be video encoder 114 in the system 100 illustrated in FIG. 14.

Video encoder 200 may be configured to perform any or all of thetechniques of this disclosure. In the example of FIG. 15 , video encoder200 includes a plurality of functional components. The techniquesdescribed in this disclosure may be shared among the various componentsof video encoder 200. In some examples, a processor may be configured toperform any or all of the techniques described in this disclosure.

The functional components of video encoder 200 may include a partitionunit 201, a prediction unit 202 which may include a mode select unit203, a motion estimation unit 204, a motion compensation unit 205 and anintra prediction unit 206, a residual generation unit 207, a transformunit 208, a quantization unit 209, an inverse quantization unit 210, aninverse transform unit 211, a reconstruction unit 212, a buffer 213, andan entropy encoding unit 214.

In other examples, video encoder 200 may include more, fewer, ordifferent functional components. In an example, prediction unit 202 mayinclude an intra block copy (IBC) unit. The IBC unit may performprediction in an IBC mode in which at least one reference picture is apicture where the current video block is located.

Furthermore, some components, such as motion estimation unit 204 andmotion compensation unit 205 may be highly integrated, but arerepresented in the example of FIG. 15 separately for purposes ofexplanation.

Partition unit 201 may partition a picture into one or more videoblocks. Video encoder 200 and video decoder 300 may support variousvideo block sizes.

Mode select unit 203 may select one of the coding modes, intra or inter,e.g., based on error results, and provide the resulting intra- orinter-coded block to a residual generation unit 207 to generate residualblock data and to a reconstruction unit 212 to reconstruct the encodedblock for use as a reference picture. In some example, Mode select unit203 may select a combination of intra and inter prediction (CIIP) modein which the prediction is based on an inter prediction signal and anintra prediction signal. Mode select unit 203 may also select aresolution for a motion vector (e.g., a sub-pixel or integer pixelprecision) for the block in the case of inter-prediction.

To perform inter prediction on a current video block, motion estimationunit 204 may generate motion information for the current video block bycomparing one or more reference frames from buffer 213 to the currentvideo block. Motion compensation unit 205 may determine a predictedvideo block for the current video block based on the motion informationand decoded samples of pictures from buffer 213 other than the pictureassociated with the current video block.

Motion estimation unit 204 and motion compensation unit 205 may performdifferent operations for a current video block, for example, dependingon whether the current video block is in an I slice, a P slice, or a Bslice.

In some examples, motion estimation unit 204 may perform uni-directionalprediction for the current video block, and motion estimation unit 204may search reference pictures of list 0 or list 1 for a reference videoblock for the current video block. Motion estimation unit 204 may thengenerate a reference index that indicates the reference picture in list0 or list 1 that contains the reference video block and a motion vectorthat indicates a spatial displacement between the current video blockand the reference video block. Motion estimation unit 204 may output thereference index, a prediction direction indicator, and the motion vectoras the motion information of the current video block. Motioncompensation unit 205 may generate the predicted video block of thecurrent block based on the reference video block indicated by the motioninformation of the current video block.

In other examples, motion estimation unit 204 may perform bi-directionalprediction for the current video block, motion estimation unit 204 maysearch the reference pictures in list 0 for a reference video block forthe current video block and may also search the reference pictures inlist 1 for another reference video block for the current video block.Motion estimation unit 204 may then generate reference indexes thatindicate the reference pictures in list 0 and list 1 containing thereference video blocks and motion vectors that indicate spatialdisplacements between the reference video blocks and the current videoblock. Motion estimation unit 204 may output the reference indexes andthe motion vectors of the current video block as the motion informationof the current video block. Motion compensation unit 205 may generatethe predicted video block of the current video block based on thereference video blocks indicated by the motion information of thecurrent video block.

In some examples, motion estimation unit 204 may output a full set ofmotion information for decoding processing of a decoder.

In some examples, motion estimation unit 204 may not output a full setof motion information for the current video. Rather, motion estimationunit 204 may signal the motion information of the current video blockwith reference to the motion information of another video block. Forexample, motion estimation unit 204 may determine that the motioninformation of the current video block is sufficiently similar to themotion information of a neighboring video block.

In one example, motion estimation unit 204 may indicate, in a syntaxstructure associated with the current video block, a value thatindicates to the video decoder 300 that the current video block has thesame motion information as another video block.

In another example, motion estimation unit 204 may identify, in a syntaxstructure associated with the current video block, another video blockand a motion vector difference (MVD). The motion vector differenceindicates a difference between the motion vector of the current videoblock and the motion vector of the indicated video block. The videodecoder 300 may use the motion vector of the indicated video block andthe motion vector difference to determine the motion vector of thecurrent video block.

As discussed above, video encoder 200 may predictively signal the motionvector. Two examples of predictive signaling techniques that may beimplemented by video encoder 200 include advanced motion vectorprediction (AMVP) and merge mode signaling.

Intra prediction unit 206 may perform intra prediction on the currentvideo block. When intra prediction unit 206 performs intra prediction onthe current video block, intra prediction unit 206 may generateprediction data for the current video block based on decoded samples ofother video blocks in the same picture. The prediction data for thecurrent video block may include a predicted video block and varioussyntax elements.

Residual generation unit 207 may generate residual data for the currentvideo block by subtracting (e.g., indicated by the minus sign) thepredicted video block(s) of the current video block from the currentvideo block. The residual data of the current video block may includeresidual video blocks that correspond to different sample components ofthe samples in the current video block.

In other examples, there may be no residual data for the current videoblock for the current video block, for example in a skip mode, andresidual generation unit 207 may not perform the subtracting operation.

Transform processing unit 208 may generate one or more transformcoefficient video blocks for the current video block by applying one ormore transforms to a residual video block associated with the currentvideo block.

After transform processing unit 208 generates a transform coefficientvideo block associated with the current video block, quantization unit209 may quantize the transform coefficient video block associated withthe current video block based on one or more quantization parameter (QP)values associated with the current video block.

Inverse quantization unit 210 and inverse transform unit 211 may applyinverse quantization and inverse transforms to the transform coefficientvideo block, respectively, to reconstruct a residual video block fromthe transform coefficient video block. Reconstruction unit 212 may addthe reconstructed residual video block to corresponding samples from oneor more predicted video blocks generated by the prediction unit 202 toproduce a reconstructed video block associated with the current blockfor storage in the buffer 213.

After reconstruction unit 212 reconstructs the video block, loopfiltering operation may be performed reduce video blocking artifacts inthe video block.

Entropy encoding unit 214 may receive data from other functionalcomponents of the video encoder 200. When entropy encoding unit 214receives the data, entropy encoding unit 214 may perform one or moreentropy encoding operations to generate entropy encoded data and outputa bitstream that includes the entropy encoded data.

FIG. 16 is a block diagram illustrating an example of video decoder 300which may be video decoder 124 in the system 100 illustrated in FIG. 14.

The video decoder 300 may be configured to perform any or all of thetechniques of this disclosure. In the example of FIG. 16 , the videodecoder 300 includes a plurality of functional components. Thetechniques described in this disclosure may be shared among the variouscomponents of the video decoder 300. In some examples, a processor maybe configured to perform any or all of the techniques described in thisdisclosure.

In the example of FIG. 16 , video decoder 300 includes an entropydecoding unit 301, a motion compensation unit 302, an intra predictionunit 303, an inverse quantization unit 304, an inverse transformationunit 305, and a reconstruction unit 306 and a buffer 307. Video decoder300 may, in some examples, perform a decoding pass generally reciprocalto the encoding pass described with respect to video encoder 200 (e.g.,FIG. 15 ).

Entropy decoding unit 301 may retrieve an encoded bitstream. The encodedbitstream may include entropy coded video data (e.g., encoded blocks ofvideo data). Entropy decoding unit 301 may decode the entropy codedvideo data, and from the entropy decoded video data, motion compensationunit 302 may determine motion information including motion vectors,motion vector precision, reference picture list indexes, and othermotion information. Motion compensation unit 302 may, for example,determine such information by performing the AMVP and merge mode.

Motion compensation unit 302 may produce motion compensated blocks,possibly performing interpolation based on interpolation filters.Identifiers for interpolation filters to be used with sub-pixelprecision may be included in the syntax elements.

Motion compensation unit 302 may use interpolation filters as used byvideo encoder 20 during encoding of the video block to calculateinterpolated values for sub-integer pixels of a reference block. Motioncompensation unit 302 may determine the interpolation filters used byvideo encoder 200 according to received syntax information and use theinterpolation filters to produce predictive blocks.

Motion compensation unit 302 may use some of the syntax information todetermine sizes of blocks used to encode frame(s) and/or slice(s) of theencoded video sequence, partition information that describes how eachmacroblock of a picture of the encoded video sequence is partitioned,modes indicating how each partition is encoded, one or more referenceframes (and reference frame lists) for each inter-encoded block, andother information to decode the encoded video sequence.

Intra prediction unit 303 may use intra prediction modes for examplereceived in the bitstream to form a prediction block from spatiallyadjacent blocks. Inverse quantization unit 303 inverse quantizes, i.e.,de-quantizes, the quantized video block coefficients provided in thebitstream and decoded by entropy decoding unit 301. Inverse transformunit 303 applies an inverse transform.

Reconstruction unit 306 may sum the residual blocks with thecorresponding prediction blocks generated by motion compensation unit302 or intra-prediction unit 303 to form decoded blocks. If desired, adeblocking filter may also be applied to filter the decoded blocks inorder to remove blockiness artifacts. The decoded video blocks are thenstored in buffer 307, which provides reference blocks for subsequentmotion compensation.

The following sets of clauses provide examples preferred by someembodiments is provided next.

The first set of clauses show example embodiments of techniquesdiscussed in items 18 and 19 of the previous section.

1. A method of video processing (e.g., method 1700 as shown in FIG.17A), comprising: determining 1702, for a conversion between a videoblock of a video having a 4:2:2 color format and a bitstream of thevideo, a parameter of a cross-component linear model for the video blockaccording to a rule; and performing 1704 the conversion based on thedetermining, and wherein a syntax element indicates whether chromasamples of the video are vertically shifted relative to luma samples ofthe video, and wherein the rule specifies that the parameter isdetermined independent of a value of the syntax element.

2. The method of clause 1, wherein the parameter of the cross-componentlinear model corresponds to a parameter of down-sampling filtering inthe cross-component linear model.

3. The method of clause 2, wherein the down-sampling filtering includesdownsampling neighboring above luma samples, and/or downsamplingneighboring left luma samples, and/or downsampling samples in the videoblock that is a luma block.

4. The method of clause 2 or 3, wherein the down-sampling filtering isperformed using a fixed filter regardless of a value of the syntaxelement.

5. The method of clause 4, wherein the fixed filter is a 3-taphorizontal filter with coefficients [1/4, 2/4, 1/4] or [2/8, 4/8, 2/8].

6. A method of video processing (e.g., method 1710 as shown in FIG.17B), comprising: performing a conversion between a video and abitstream of the video according to a rule, and wherein the format rulespecifies that a field indicating whether chroma samples positions arevertically shifted relative to corresponding luma sample positions isset to a default value due to the video having 4:2:2 or 4:4:4 colorformat.

7. The method of clause 6, wherein the default value is 0 or 1.

8. The method of clause 6, wherein the rule further specifies, in casethat the field is not present, a value of the field is inferred to beequal to 1.

9. The method of clause 6, wherein the rule further specifies, in casethat the field is not present, a value of the field is inferred to beequal to 0.

10. The method of any of clauses 1 to 9, wherein the cross-componentlinear model uses a linear mode to derive prediction values of a chromacomponent from another component.

11. The method of any of clauses 1 to 9, wherein the conversion includesencoding the video into the bitstream.

12. The method of any of clauses 1 to 9, wherein the conversion includesdecoding the video from the bitstream.

13. The method of any of clauses 1 to 12, wherein the conversionincludes generating the bitstream from the video, and the method furthercomprises: storing the bitstream in a non-transitory computer-readablerecording medium.

14. A video processing apparatus comprising a processor configured toimplement a method recited in any one or more of clauses 1 to 12.

15. A method of storing a bitstream of a video, comprising, a methodrecited in any one of clauses 1 to 12, and further including storing thebitstream to a non-transitory computer-readable recording medium.

16. A computer readable medium storing program code that, when executed,causes a processor to implement a method recited in any one or more ofclauses 1 to 12.

17. A computer readable medium that stores a bitstream generatedaccording to any of the above described methods.

18. A video processing apparatus for storing a bitstream representation,wherein the video processing apparatus is configured to implement amethod recited in any one or more of clauses 1 to 12.

The second set of clauses show example embodiments of techniquesdiscussed in item 20 of the previous section.

1. A method of video processing (e.g., method 1800 as shown in FIG. 18), comprising: determining 1802, for a conversion between a video blockof a video and a bitstream of the video, a parameter of across-component linear model (CCLM) for the video block according to arule; and performing 1804 the conversion based on the determining, andwherein the rule specifies to use a variable representing a neighbouringluma sample in the determining of the parameter of the CCLM only in casethat the variable has a certain value.

2. The method of clause 1, wherein the certain value of the variablerepresenting a neighbouring above luma sample of the video block isequal to that of a reconstructed luma sample prior to a deblockingfilter process.

3. The method of clause 2, wherein in case that the neighbouring aboveluma sample is available, the variable representing the neighbouringabove luma sample denoted as pY [x][y] is set equal to the reconstructedluma sample prior to the deblocking filter process at a location(xTbY+x, yTbY+y), where (xTbY, yTbY) represents a top-left position ofthe video block and x and y are integers.

4. The method of clause 3, wherein x is in a range of 0 toSubWidthC*max(numSampT, nTbW)−1, whereby nTbW denotes a width of thevideo block, SubWidthC is a width scale factor of the video block andobtained from a table according to a chroma format of a pictureincluding the video block, and numSampT indicates a number of availableneighbouring chroma samples on a top and top-right of the video block.

5. The method of clause 3, wherein y is −1 or −2.

6. The method of clause 1, wherein a value of the variable representinga neighboring left luma sample of the video block is set equal to thatof a reconstructed luma sample prior to a deblocking filter process.

7. The method of clause 6, wherein in case that the neighbouring leftluma sample is available, the variable representing the neighbouringleft luma sample denoted as pY [x][y] is set equal to the reconstructedluma sample prior to the deblocking filter process at a location(xTbY+x, yTbY+y), where (xTbY, yTbY) represents a top-left position ofthe video block and x and y are integers.

8. The method of clause 7, wherein x is in a range of −1 to −3.

9. The method of clause 7, wherein y is in a range of 0 toSubHeightC*max(numSampL, nTbH)−1, where nTbH denotes a height of thevideo block, and SubHeightC is a height scale factor of the video blockand obtained from a table according to a chroma format of a pictureincluding the video block, and numSampL indicates a number of availableneighbouring chroma samples on a left and left-below of the video block.

10. The method of any of clauses 1 to 9, wherein the cross-componentlinear model uses a linear mode to derive prediction values of a chromacomponent from another component.

11. The method of any of clauses 1 to 9, wherein the conversion includesencoding the video into the bitstream.

12. The method of any of clauses 1 to 9, wherein the conversion includesdecoding the video from the bitstream.

13. The method of any of clauses 1 to 12, wherein the conversionincludes generating the bitstream from the video, and the method furthercomprises: storing the bitstream in a non-transitory computer-readablerecording medium.

14. A video processing apparatus comprising a processor configured toimplement a method recited in any one or more of clauses 1 to 12.

15. A method of storing a bitstream of a video, comprising, a methodrecited in any one of clauses 1 to 12, and further including storing thebitstream to a non-transitory computer-readable recording medium.

16. A computer readable medium storing program code that, when executed,causes a processor to implement a method recited in any one or more ofclauses 1 to 12.

17. A computer readable medium that stores a bitstream generatedaccording to any of the above described methods.

18. A video processing apparatus for storing a bitstream, wherein thevideo processing apparatus is configured to implement a method recitedin any one or more of clauses 1 to 12.

The third set of clauses show example embodiments of techniquesdiscussed in items 21-26 of the previous section.

1. A method of video processing (e.g., method 1900 as shown in FIG.19A), comprising: determining 1902, for a conversion between a videocomprising a video unit and a bitstream of the video, whether a firstcoding tool is enabled for the video unit according to a rule, whereinthe rule specifies that the first coding tool and a second coding toolare mutually exclusively enabled, and wherein the first coding tool orthe second coding tool comprises a sign data hiding tool; and performing1904 the conversion according to the determining.

2. The method of clause 1, wherein the video unit corresponds to asequence, a picture, a slice, a tile, a brick, or a subpicture.

3. The method of clause 1 or 2, wherein the rule specifies to disablethe first coding tool comprising the sign data hiding tool in case thatthe second coding tool comprising a block differential pulse-codemodulation (BDPCM) tool is enabled for the video unit.

4. The method of clause 1 or 2, wherein the rule specifies to disablethe first coding tool comprising a block differential pulse-codemodulation (BDPCM) tool in case that the second coding tool comprisingthe sign data hiding tool is enabled for the video unit.

5. The method of clause 1 or 2, wherein rule specifies to disable thefirst coding tool comprising the sign data hiding tool in case that thesecond coding tool that only applies an identity transform is enabledfor the video unit.

6. The method of clause 1 or 2, wherein the rule specifies to disablethe first coding tool that only applies an identity transform in casethat the second coding tool comprising the sign data hiding tool isenabled for the video unit.

7. The method of clause 5 or 6, wherein the second coding tool that onlyapplies the identity transform or the first coding tool that onlyapplies the identity transform comprises a transform skip mode tool orother coding tools.

8. A method of video processing (e.g., method 1910 as shown in FIG.19B), comprising: determining 1912, for a conversion between a videocomprising a video unit and a bitstream of the video, whether a firstcoding tool is enabled for the video unit according to a rule, whereinthe rule specifies that the first coding tool and a second coding toolare mutually exclusively enabled, and wherein the first coding tool orthe second coding tool comprises a dependent quantization tool; andperforming 1914 the conversion according to the determining.

9. The method of clause 8, wherein the video unit corresponds to asequence, a picture, a slice, a tile, a brick, or a subpicture.

10. The method of clause 8 or 9, wherein the rule specifies to disablethe first coding tool comprising the dependent quantization tool in casethat the second coding tool comprising a block differential pulse-codemodulation (BDPCM) tool is enabled for the video unit.

11. The method of clause 8 or 9, wherein the rule specifies to disablethe first coding tool comprising a block differential pulse-codemodulation (BDPCM) tool in case that the second coding tool comprisingthe dependent quantization tool is enabled for the video unit.

12. The method of clause 8 or 9, wherein the rule specifies to disablethe first coding tool comprising the dependent quantization tool in casethat the second coding tool that only applies an identity transform isenabled for the video unit.

13. The method of clause 8 or 9, wherein the rule specifies to disablethe first coding tool that only applies an identity transform in casethat the second coding tool comprising the dependent quantization isenabled for the video unit.

14. The method of clause 8 or 9, wherein the second coding tool thatonly applies the identity transform or the first coding tool that onlyapplies the identity transform comprises a transform skip mode tool orother coding tools.

15. A method of video processing (e.g., method 1920 as shown in FIG.19C), comprising: performing 1922 a conversion between a videocomprising one or more pictures comprising one or more slices and abitstream of the video according to a rule, and wherein the rulespecifies that a slice type of a slice depends on reference pictureentries of a reference picture list for the slice.

16. The method of clause 15, wherein the rule specifies that the slicetype of the slice is I-slice in case that a number of the referencepicture entries of a reference picture list 0 is equal to 0 and a numberof reference picture entries for a reference picture list 1 is equal to0.

17. The method of clause 15, wherein the rule specifies that the slicetype of the slice is P-slice in case that a number of the referencepicture entries of a reference picture list 0 is greater than 0 and anumber of reference picture entries for a reference picture list 1 isequal to 0.

18. The method of clause 15, wherein the rule specifies that the slicetype of the slice is not B-slice in case that a number of referencepicture entries of a reference picture list 0 is greater than 0 and anumber of reference picture entries for a reference picture list 1 isequal to 0.

19. The method of any of clauses 16 to 18, wherein the slice type is notincluded in the bitstream.

20. The method of clause 15, wherein the reference picture entries aresignaled or inferred before the slice type is signaled or inferred.

21. The method of clause 15, wherein the reference picture entries areincluded in a picture header associated with a picture including theslice.

22. A method of video processing (e.g., method 1930 as shown in FIG.19D), comprising: performing 1932 a conversion between a videocomprising one or more pictures comprising one or more slices and abitstream of the video according to a rule, and wherein the rulespecifies that a number of allowed filters in adaptation parameter sets(APSs) or a number of APSs depends on coded information of the video.

23. The method of clause 22, wherein the coded information includes anumber of subpictures of a picture.

24. The method of clause 22, wherein the number of the allowed filtersin the APSs includes a number of luma adaptive loop filters (ALFs),chroma ALFs, and cross-component ALFs in ALF APSs in all adaptationparameter set (APS) network abstraction layer (NAL) units within apicture unit.

25. The method of clause 22, wherein the number of the allowed filtersin APSs includes a number of adaptive loop filter (ALF) classes for lumacomponent, a number of alternative filters for chroma components, and/ora number of cross-component filters in all adaptation parameter set(APS) network abstraction layer (NAL) units within a picture unit

26. The method of clause 22, wherein the APSs correspond to ALF APSs,scaling list APSs, and/or LMCS (luma mapping with chroma scaling) APSs.

27. The method of clause 22, wherein how to signal an APS identifierand/or the number of APSs to be used by a video unit is dependent on thenumber of the allowed filters in the APSs.

28. The method of any of clauses 1 to 27, wherein the conversionincludes encoding the video into the bitstream.

29. The method of any of clauses 1 to 27, wherein the conversionincludes decoding the video from the bitstream.

30. The method of any of clauses 1 to 27, wherein the conversionincludes generating the bitstream from the video, and the method furthercomprises: storing the bitstream in a non-transitory computer-readablerecording medium.

31. A video processing apparatus comprising a processor configured toimplement a method recited in any one or more of clauses 1 to 30.

32. A method of storing a bitstream of a video, comprising, a methodrecited in any one of clauses 1 to 30, and further including storing thebitstream to a non-transitory computer-readable recording medium.

33. A computer readable medium storing program code that, when executed,causes a processor to implement a method recited in any one or more ofclauses 1 to 30.

34. A computer readable medium that stores a bitstream generatedaccording to any of the above described methods.

35. A video processing apparatus for storing a bitstream, wherein thevideo processing apparatus is configured to implement a method recitedin any one or more of clauses 1 to 30.

Some embodiments of the disclosed technology include making a decisionor determination to enable a video processing tool or mode. In anexample, when the video processing tool or mode is enabled, the encoderwill use or implement the tool or mode in the processing of a block ofvideo, but may not necessarily modify the resulting bitstream based onthe usage of the tool or mode. That is, a conversion from the block ofvideo to the bitstream representation of the video will use the videoprocessing tool or mode when it is enabled based on the decision ordetermination. In another example, when the video processing tool ormode is enabled, the decoder will process the bitstream with theknowledge that the bitstream has been modified based on the videoprocessing tool or mode. That is, a conversion from the bitstreamrepresentation of the video to the block of video will be performedusing the video processing tool or mode that was enabled based on thedecision or determination.

Some embodiments of the disclosed technology include making a decisionor determination to disable a video processing tool or mode. In anexample, when the video processing tool or mode is disabled, the encoderwill not use the tool or mode in the conversion of the block of video tothe bitstream representation of the video. In another example, when thevideo processing tool or mode is disabled, the decoder will process thebitstream with the knowledge that the bitstream has not been modifiedusing the video processing tool or mode that was enabled based on thedecision or determination.

The disclosed and other solutions, examples, embodiments, modules andthe functional operations described in this disclosure can beimplemented in digital electronic circuitry, or in computer software,firmware, or hardware, including the structures disclosed in thisdisclosure and their structural equivalents, or in combinations of oneor more of them. The disclosed and other embodiments can be implementedas one or more computer program products, i.e., one or more modules ofcomputer program instructions encoded on a computer readable medium forexecution by, or to control the operation of, data processing apparatus.The computer readable medium can be a machine-readable storage device, amachine-readable storage substrate, a memory device, a composition ofmatter effecting a machine-readable propagated signal, or a combinationof one or more them. The term “data processing apparatus” encompassesall apparatus, devices, and machines for processing data, including byway of example a programmable processor, a computer, or multipleprocessors or computers. The apparatus can include, in addition tohardware, code that creates an execution environment for the computerprogram in question, e.g., code that constitutes processor firmware, aprotocol stack, a database management system, an operating system, or acombination of one or more of them. A propagated signal is anartificially generated signal, e.g., a machine-generated electrical,optical, or electromagnetic signal, that is generated to encodeinformation for transmission to suitable receiver apparatus.

A computer program (also known as a program, software, softwareapplication, script, or code) can be written in any form of programminglanguage, including compiled or interpreted languages, and it can bedeployed in any form, including as a stand-alone program or as a module,component, subroutine, or other unit suitable for use in a computingenvironment. A computer program does not necessarily correspond to afile in a file system. A program can be stored in a portion of a filethat holds other programs or data (e.g., one or more scripts stored in amarkup language document), in a single file dedicated to the program inquestion, or in multiple coordinated files (e.g., files that store oneor more modules, sub programs, or portions of code). A computer programcan be deployed to be executed on one computer or on multiple computersthat are located at one site or distributed across multiple sites andinterconnected by a communication network.

The processes and logic flows described in this disclosure can beperformed by one or more programmable processors executing one or morecomputer programs to perform functions by operating on input data andgenerating output. The processes and logic flows can also be performedby, and apparatus can also be implemented as, special purpose logiccircuitry, e.g., a field programmable gate array (FPGA) or anapplication specific integrated circuit (ASIC).

Processors suitable for the execution of a computer program include, byway of example, both general and special purpose microprocessors, andany one or more processors of any kind of digital computer. Generally, aprocessor will receive instructions and data from a read only memory ora random-access memory or both. The essential elements of a computer area processor for performing instructions and one or more memory devicesfor storing instructions and data. Generally, a computer will alsoinclude, or be operatively coupled to receive data from or transfer datato, or both, one or more mass storage devices for storing data, e.g.,magnetic, magneto optical disks, or optical disks. However, a computerneed not have such devices. Computer readable media suitable for storingcomputer program instructions and data include all forms of non-volatilememory, media and memory devices, including by way of examplesemiconductor memory devices, e.g., erasable programmable read-onlymemory (EPROM), electrically erasable programmable read-only memory(EEPROM), and flash memory devices; magnetic disks, e.g., internal harddisks or removable disks; magneto optical disks; and compact disc,read-only memory (CD ROM) and digital versatile disc read-only memory(DVD-ROM) disks. The processor and the memory can be supplemented by, orincorporated in, special purpose logic circuitry.

While the present disclosure contains many specifics, these should notbe construed as limitations on the scope of any subject matter or ofwhat may be claimed, but rather as descriptions of features that may bespecific to particular embodiments of particular techniques. Certainfeatures that are described in the present disclosure in the context ofseparate embodiments can also be implemented in combination in a singleembodiment. Conversely, various features that are described in thecontext of a single embodiment can also be implemented in multipleembodiments separately or in any suitable subcombination. Moreover,although features may be described above as acting in certaincombinations and even initially claimed as such, one or more featuresfrom a claimed combination can in some cases be excised from thecombination, and the claimed combination may be directed to asubcombination or variation of a subcombination.

Similarly, while operations are depicted in the drawings in a particularorder, this should not be understood as requiring that such operationsbe performed in the particular order shown or in sequential order, orthat all illustrated operations be performed, to achieve desirableresults. Moreover, the separation of various system components in theembodiments described in the present disclosure should not be understoodas requiring such separation in all embodiments.

Only a few implementations and examples are described and otherimplementations, enhancements and variations can be made based on whatis described and illustrated in the present disclosure.

What is claimed is:
 1. A method for processing video data, comprising:determining, for a conversion between a chroma block of a video and abitstream of the video, a parameter of a cross-component linear modelfor the chroma block according to a rule; and performing the conversionbased on the determining, wherein the rule specifies that the parameterof the cross-component linear model is determined based on neighbouringchroma samples of the chroma block and down-sampled collocated lumasamples derived based on variables representing neighbouring lumasamples of a luma block corresponding to the chroma block, wherein therule further specifies that when a color format of the chroma block is4:2:0, the down-sampled collocated luma samples is derived further basedon at least one of a value of a first syntax element and a value of afirst variable, wherein the first syntax element is included in thebitstream indicating whether chroma sample positions are verticallyshifted relative to corresponding luma sample position, and the firstvariable indicates whether the chroma block locates at a boundary of acoding tree unit comprising the chroma block, and wherein the rulefurther specifies that when the color format of the chroma block is4:2:2, the down-sampled collocated luma samples is derived withoutconsidering the value of the first syntax element.
 2. The method ofclaim 1, wherein the rule further specifies that when the color formatof the chroma block is 4:2:2, the down-sampled collocated luma samplesare obtained using a fixed filter regardless of the value of the firstsyntax element, wherein the fixed filter is a 3-tap horizontal filter.3. The method of claim 2, wherein when using the fixed filter,pSelDsY[i]=(pY[SubWidthC*x−1][−1]+2*pY[SubWidthC*x][−1]+pY[SubWidthC*x+1][−1]+2)>>2,where pSelDsY[i] denotes a down-sampled collocated luma sample with anindex of i, and pY[m][n] denotes a neighbouring luma sample with alocation of (m, n).
 4. The method of claim 1, wherein the rule furtherspecifies that when the value of the first variable indicates that thechroma block locates at the boundary of the coding tree unit comprisingthe chroma block, the down-sampled collocated luma samples is derivedusing a same filter for the chroma block having the color format of4:2:0 and the chroma block having the color format of 4:2:2.
 5. Themethod of claim 4, wherein the rule further specifies that when thevalue of the first variable indicates that the chroma block locates atthe boundary of the coding tree unit comprising the chroma block, thedown-sampled collocated luma samples is derived using a same filterregardless of the value of the first syntax element.
 6. The method ofclaim 5, wherein the rule further specifies that when the value of thefirst variable indicates that the chroma block does not locate at theboundary of the coding tree unit comprising the chroma block and thecolor format of the chroma block is 4:2:0, the down-sampled collocatedluma samples are obtained using different filters in response to thefirst syntax element having different values.
 7. The method of claim 6,wherein the rule further specifies that when the value of the firstvariable indicates that the chroma block does not locate at the boundaryof the coding tree unit comprising the chroma block and the color formatof the chroma block is 4:2:0, pSelDsY[i] is equal to(pY[SubWidthC*x][−3]+pY[SubWidthC*x−1][−2]+4*pY[SubWidthC*x][−2]+pY[SubWidthC*x+1][−2]+pY[SubWidthC*x][−1]+4)>>3in response to the first syntax element having a value of 1, wherepSelDsY[i] denotes a down-sampled collocated luma sample with an indexof i, and pY[m][n] denotes a neighbouring luma sample with a location of(m, n).
 8. The method of claim 6, wherein the rule further specifiesthat when the value of the first variable indicates that the chromablock does not locate at the boundary of the coding tree unit comprisingthe chroma block and the color format of the chroma block is 4:2:0,pSelDsY[i] is equal to (pY[SubWidthCx−1][−1]+pY[SubWidthC*x−1][−2]+2*pY[SubWidthC*x][−1]+2*pY[SubWidthC*x][−2]+pY[SubWidthC*x+1][−1]+pY[SubWidthC*x+1][−2]+4)>>3in response to the first syntax element having a value of 0, wherepSelDsY[i] denotes a down-sampled collocated luma sample with an indexof i, and pY[m][n] denotes a neighbouring luma sample with a location of(m, n).
 9. The method of claim 1, wherein the variables representingneighbouring luma samples are derived based on at least one of thefollowing: neighbouring above luma samples of the luma block,neighbouring left luma samples of the luma block, or samples in the lumablock.
 10. The method of claim 1, wherein the rule further specifies, incase that the first syntax element is not present, the value of thefirst syntax element is inferred to be equal to
 1. 11. The method ofclaim 1, wherein the conversion includes encoding the video into thebitstream.
 12. The method of claim 1, wherein the conversion includesdecoding the video from the bitstream.
 13. An apparatus for processingvideo data comprising a processor and a non-transitory memory withinstructions thereon, wherein the instructions upon execution by theprocessor, cause the processor to: determine, for a conversion between achroma block of a video and a bitstream of the video, a parameter of across-component linear model for the chroma block according to a rule;and perform the conversion based on the determining, wherein the rulespecifies that the parameter of the cross-component linear model isdetermined based on neighbouring chroma samples of the chroma block anddown-sampled collocated luma samples derived based on variablesrepresenting neighbouring luma samples of a luma block corresponding tothe chroma block, wherein the rule further specifies that when a colorformat of the chroma block is 4:2:0, the down-sampled collocated lumasamples is derived further based on at least one of a value of a firstsyntax element and a value of a first variable, wherein the first syntaxelement is included in the bitstream indicating whether chroma samplepositions are vertically shifted relative to corresponding luma sampleposition, and the first variable indicates whether the chroma blocklocates at a boundary of a coding tree unit comprising the chroma block,and wherein the rule further specifies that when the color format of thechroma block is 4:2:2, the down-sampled collocated luma samples isderived without considering the value of the first syntax element. 14.The apparatus of claim 13, wherein the rule further specifies that whenthe value of the first variable indicates that the chroma block locatesat the boundary of the coding tree unit comprising the chroma block, thedown-sampled collocated luma samples is derived using a same filter forthe chroma block having the color format of 4:2:0 and the chroma blockhaving the color format of 4:2:2, and wherein the rule further specifiesthat when the value of the first variable indicates that the chromablock locates at the boundary of the coding tree unit comprising thechroma block, the down-sampled collocated luma samples is derived usinga same filter regardless of the value of the first syntax element. 15.The apparatus of claim 13, wherein the rule further specifies that whenthe value of the first variable indicates that the chroma block does notlocate at the boundary of the coding tree unit comprising the chromablock and the color format of the chroma block is 4:2:0, thedown-sampled collocated luma samples are obtained using differentfilters in response to the first syntax element having different values.16. The apparatus of claim 14, wherein the rule further specifies thatwhen the value of the first variable indicates that the chroma blockdoes not locate at the boundary of the coding tree unit comprising thechroma block and the color format of the chroma block is 4:2:0,pSelDsY[i] is equal to(pY[SubWidthC*x][−3]+pY[SubWidthC*x−1][−2]+4*pY[SubWidthC*x][−2]+pY[SubWidthC*x+1][−2]+pY[SubWidthC*x][−1]+4)>>3in response to the first syntax element having a value of 1, wherepSelDsY[i] denotes a down-sampled collocated luma sample with an indexof i, and pY[m][n] denotes a neighbouring luma sample with a location of(m, n), or wherein the rule further specifies that when the value of thefirst variable indicates that the chroma block does not locate at theboundary of the coding tree unit comprising the chroma block and thecolor format of the chroma block is 4:2:0, pSelDsY[i] is equal to(pY[SubWidthCx−1][−1]+pY[SubWidthC*x−1][−2]+2*pY[SubWidthC*x][−1]+2*pY[SubWidthC*x][−2]+pY[SubWidthC*x+1][−1]+pY[SubWidthC*x+1][−2]+4)>>3in response to the first syntax element having a value of 0, wherepSelDsY[i] denotes a down-sampled collocated luma sample with an indexof i, and pY[m][n] denotes the neighbouring luma sample with a locationof (m, n).
 17. A non-transitory computer-readable storage medium storinginstructions that cause a processor to: determine, for a conversionbetween a chroma block of a video and a bitstream of the video, aparameter of a cross-component linear model for the chroma blockaccording to a rule; and perform the conversion based on thedetermining, wherein the rule specifies that the parameter of thecross-component linear model is determined based on neighbouring chromasamples of the chroma block and down-sampled collocated luma samplesderived based on variables representing neighbouring luma samples of aluma block corresponding to the chroma block, wherein the rule furtherspecifies that when a color format of the chroma block is 4:2:0, thedown-sampled collocated luma samples is derived further based on atleast one of a value of a first syntax element and a value of a firstvariable, wherein the first syntax element is included in the bitstreamindicating whether chroma sample positions are vertically shiftedrelative to corresponding luma sample position, and the first variableindicates whether the chroma block locates at a boundary of a codingtree unit comprising the chroma block, and wherein the rule furtherspecifies that when the color format of the chroma block is 4:2:2, thedown-sampled collocated luma samples is derived without considering thevalue of the first syntax element.
 18. The non-transitorycomputer-readable storage medium of claim 17, wherein the rule furtherspecifies that when the value of the first variable indicates that thechroma block locates at the boundary of the coding tree unit comprisingthe chroma block, the down-sampled collocated luma samples is derivedusing a same filter for the chroma block having the color format of4:2:0 and the chroma block having the color format of 4:2:2, wherein therule further specifies that when the value of the first variableindicates that the chroma block locates at the boundary of the codingtree unit comprising the chroma block, the down-sampled collocated lumasamples is derived using a same filter regardless of the value of thefirst syntax element.
 19. A non-transitory computer-readable recordingmedium storing a bitstream of a video which is generated by a methodperformed by a video processing apparatus, wherein the method comprises:determining a parameter of a cross-component linear model for a chromablock of the video according to a rule; and generating the bitstreambased go the determining, wherein the rule specifies that the parameterof the cross-component linear model is determined based on neighbouringchroma samples of the chroma block and down-sampled collocated lumasamples derived based on variables representing neighbouring lumasamples of a luma block corresponding to the chroma block, wherein therule further specifies that when a color format of the chroma block is4:2:0, the down-sampled collocated luma samples is derived further basedon at least one of a value of a first syntax element and a value of afirst variable, wherein the first syntax element is included in thebitstream indicating whether chroma sample positions are verticallyshifted relative to corresponding luma sample position, and the firstvariable indicates whether the chroma block locates at a boundary of acoding tree unit comprising the chroma block, and wherein the rulefurther specifies that when the color format of the chroma block is4:2:2, the down-sampled collocated luma samples is derived withoutconsidering the value of the first syntax element.
 20. Thenon-transitory computer-readable recording medium of claim 19, whereinthe rule further specifies that when the value of the first variableindicates that the chroma block locates at the boundary of the codingtree unit comprising the chroma block, the down-sampled collocated lumasamples is derived using a same filter for the chroma block having thecolor format of 4:2:0 and the chroma block having the color format of4:2:2, and wherein the rule further specifies that when the value of thefirst variable indicates that the chroma block locates at the boundaryof the coding tree unit comprising the chroma block, the down-sampledcollocated luma samples is derived using a same filter regardless of thevalue of the first syntax element.